Skip to content

Commit

Permalink
Fix clippy::unnecessary_map_or lint (#228)
Browse files Browse the repository at this point in the history
Use `is_some_and` instead.
  • Loading branch information
waywardmonkeys authored Dec 16, 2024
1 parent c5c57e8 commit eb6d5e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/vello_editor/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Editor {
}

pub fn cursor_blink(&mut self) {
self.cursor_visible = self.start_time.map_or(false, |start_time| {
self.cursor_visible = self.start_time.is_some_and(|start_time| {
let elapsed = Instant::now().duration_since(start_time);
(elapsed.as_millis() / self.blink_period.as_millis()) % 2 == 0
});
Expand Down

0 comments on commit eb6d5e5

Please sign in to comment.