summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/game_of_life/src')
-rw-r--r--examples/game_of_life/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index 17b4090d..fb4b5b75 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -159,7 +159,7 @@ mod grid {
canvas::{self, Cache, Canvas, Cursor, Event, Frame, Geometry, Path},
mouse, Color, Element, Length, Point, Rectangle, Size, Vector,
};
- use std::collections::{HashMap, HashSet};
+ use rustc_hash::{FxHashMap, FxHashSet};
pub struct Grid {
life: Life,
@@ -395,12 +395,12 @@ mod grid {
#[derive(Default)]
pub struct Life {
- cells: HashSet<Cell>,
+ cells: FxHashSet<Cell>,
}
impl Life {
fn tick(&mut self) {
- let mut adjacent_life = HashMap::new();
+ let mut adjacent_life = FxHashMap::default();
for cell in &self.cells {
let _ = adjacent_life.entry(*cell).or_insert(0);