summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life
diff options
context:
space:
mode:
Diffstat (limited to 'examples/game_of_life')
-rw-r--r--examples/game_of_life/src/main.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index c774e769..96840143 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -406,12 +406,9 @@ mod grid {
*interaction = Interaction::None;
}
- let cursor_position =
- if let Some(position) = cursor.position_in(bounds) {
- position
- } else {
- return (event::Status::Ignored, None);
- };
+ let Some(cursor_position) = cursor.position_in(bounds) else {
+ return (event::Status::Ignored, None);
+ };
let cell = Cell::at(self.project(cursor_position, bounds.size()));
let is_populated = self.state.contains(&cell);