mirror of
https://github.com/ivabus/matrix
synced 2024-12-04 22:15:07 +03:00
Update deps and fix some useless code
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
parent
2eca1003cf
commit
5448afe653
3 changed files with 12 additions and 15 deletions
|
@ -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<T>(a: &Matrix<T>) -> bool {
|
|||
}
|
||||
|
||||
pub fn sum<T: Add<Output = T> + Copy>(a: &Matrix<T>, b: &Matrix<T>) -> Option<Matrix<T>> {
|
||||
if !(check_valid(&a) && check_valid(&b)) {
|
||||
if !(check_valid(a) && check_valid(b)) {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ pub fn mul<T: Mul<Output = T> + Copy + AddAssign + From<u8>>(
|
|||
a: &Matrix<T>,
|
||||
b: &Matrix<T>,
|
||||
) -> Option<Matrix<T>> {
|
||||
if !(check_valid(&a) && check_valid(&b)) {
|
||||
if !(check_valid(a) && check_valid(b)) {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -107,8 +107,7 @@ 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 => {
|
||||
if event == Event::MainEventsCleared {
|
||||
render(pixels.get_frame_mut(), &bitmap);
|
||||
if let Err(err) = pixels.render() {
|
||||
error!("pixels.render() failed: {err}");
|
||||
|
@ -116,8 +115,6 @@ fn main() {
|
|||
return;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// Handle input events
|
||||
if input.update(&event) {
|
||||
|
|
Loading…
Reference in a new issue