From 2ced1b04738c1d028a49d3bd06cb8fb88830928c Mon Sep 17 00:00:00 2001 From: Kimon Papahadjopoulos Date: Thu, 21 Dec 2023 16:29:26 -0800 Subject: [PATCH] refactor --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8cd354d..cf13dfd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -194,7 +194,7 @@ fn fill_cells(context: &CanvasRenderingContext2d, cells: &[Cell], cell_type: Cel // Every time we get a new animation frame, draw the grid, and advance the game. // -// This includes the game itself (grid and cells) as well ad the +// This includes the game itself (grid and cells) as well as the // frames per second widget. pub fn update_frame_loop(universe: Rc>) { let f = Rc::new(RefCell::new(None)); @@ -202,8 +202,7 @@ pub fn update_frame_loop(universe: Rc>) { let mut frames_per_second = FramesPerSecond::new("frames-per-second"); - // Does not need to be FnMut if universe is behing a mutex - *g.borrow_mut() = Some(Closure::::new(move || { + *g.borrow_mut() = Some(Closure::new(move || { frames_per_second.update_frame(); let id = request_animation_frame(f.borrow().as_ref().unwrap());