diff --git a/matrix/src/lib.rs b/matrix/src/lib.rs index d82c800..9064302 100644 --- a/matrix/src/lib.rs +++ b/matrix/src/lib.rs @@ -1,4 +1,4 @@ -use std::ops::{Add, AddAssign, Mul, MulAssign}; +use std::ops::{Add, AddAssign, Mul}; use rand::{thread_rng, Rng}; @@ -17,7 +17,7 @@ fn check_valid(a: &Matrix) -> bool { } pub fn sum + Copy>(a: &Matrix, b: &Matrix) -> Option> { - if !(check_valid(&a) && check_valid(&b)) { + if !(check_valid(a) && check_valid(b)) { return None; } @@ -40,7 +40,7 @@ pub fn mul + Copy + AddAssign + From>( a: &Matrix, b: &Matrix, ) -> Option> { - if !(check_valid(&a) && check_valid(&b)) { + if !(check_valid(a) && check_valid(b)) { return None; } diff --git a/matrix_graphics/Cargo.toml b/matrix_graphics/Cargo.toml index bebf7e1..b6a3e47 100644 --- a/matrix_graphics/Cargo.toml +++ b/matrix_graphics/Cargo.toml @@ -9,10 +9,10 @@ optimize = ["log/release_max_level_warn"] default = ["optimize"] [dependencies] -env_logger = "0.10" -log = "0.4" +env_logger = "0.10.0" +log = "0.4.17" matrix = { version = "0.1.2", path = "../matrix" } pixels = "0.11.0" -winit = "0.28.1" +winit = "0.28.2" winit_input_helper = "0.14.0" bresenham = "0.1.1" diff --git a/matrix_graphics/src/main.rs b/matrix_graphics/src/main.rs index 502bf26..3558dbf 100644 --- a/matrix_graphics/src/main.rs +++ b/matrix_graphics/src/main.rs @@ -107,16 +107,13 @@ fn main() { let mut bitmap: [[bool; WIDTH as usize]; HEIGHT as usize] = [[false; WIDTH as usize]; HEIGHT as usize]; event_loop.run(move |event, _, control_flow| { - match event { - Event::MainEventsCleared => { - render(pixels.get_frame_mut(), &bitmap); - if let Err(err) = pixels.render() { - error!("pixels.render() failed: {err}"); - *control_flow = ControlFlow::Exit; - return; - } + if event == Event::MainEventsCleared { + render(pixels.get_frame_mut(), &bitmap); + if let Err(err) = pixels.render() { + error!("pixels.render() failed: {err}"); + *control_flow = ControlFlow::Exit; + return; } - _ => {} } // Handle input events