diff options
Diffstat (limited to 'examples/game_of_life')
| -rw-r--r-- | examples/game_of_life/src/main.rs | 8 | 
1 files changed, 3 insertions, 5 deletions
| diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs index fb12afa1..3989e3ea 100644 --- a/examples/game_of_life/src/main.rs +++ b/examples/game_of_life/src/main.rs @@ -200,14 +200,12 @@ mod grid {                  let is_populated = self.alive_cells.contains(&(i, j));                  match amount { -                    2 if is_populated => {} +                    2 | 3 if is_populated => {}                      3 => { -                        if !is_populated { -                            self.alive_cells.insert((i, j)); -                        } +                        let _ = self.alive_cells.insert((i, j));                      }                      _ if is_populated => { -                        self.alive_cells.remove(&(i, j)); +                        let _ = self.alive_cells.remove(&(i, j));                      }                      _ => {}                  } | 
