Fix remaining clippy warnings

Elnu 9 months ago
parent 92889532d7
commit 16e2e60221

@ -206,67 +206,64 @@ fn main() {
let mut new_highscore_sound = Sound::with_buffer(&new_highscore_buffer);
while window.is_open() {
loop {
match window.poll_event() {
Some(event) => match event {
Event::Closed | Event::KeyPressed {
code: Key::Q,
alt: _,
ctrl: true,
shift: _,
system: _,
} => window.close(),
Event::LostFocus => {
toggle_pause = true;
paused_from_lost_focus = true;
while let Some(event) = window.poll_event() {
match event {
Event::Closed | Event::KeyPressed {
code: Key::Q,
alt: _,
ctrl: true,
shift: _,
system: _,
} => window.close(),
Event::LostFocus => {
toggle_pause = true;
paused_from_lost_focus = true;
}
Event::KeyPressed {
code,
alt: _,
ctrl: true,
shift: _,
system: _,
} => {
handle_resize_events(code, &mut current_scale, &mut window, &scale_file_path);
},
Event::KeyPressed {
code,
alt: _,
ctrl: _,
shift: _,
system: _,
} => match code {
Key::ESCAPE => toggle_pause = true,
Key::SPACE => snap = true,
Key::UP => rotate = true,
Key::DOWN => fast_forward = true,
Key::LEFT => {
move_left = true;
move_left_immediate = true;
move_clock.restart();
}
Key::RIGHT => {
move_right = true;
move_right_immediate = true;
move_clock.restart();
}
Event::KeyPressed {
code,
alt: _,
ctrl: true,
shift: _,
system: _,
} => {
handle_resize_events(code, &mut current_scale, &mut window, &scale_file_path);
},
Event::KeyPressed {
code,
alt: _,
ctrl: _,
shift: _,
system: _,
} => match code {
Key::ESCAPE => toggle_pause = true,
Key::SPACE => snap = true,
Key::UP => rotate = true,
Key::DOWN => fast_forward = true,
Key::LEFT => {
move_left = true;
move_left_immediate = true;
move_clock.restart();
}
Key::RIGHT => {
move_right = true;
move_right_immediate = true;
move_clock.restart();
}
_ => {}
},
Event::KeyReleased {
code,
alt: _,
ctrl: _,
shift: _,
system: _,
} => match code {
Key::DOWN => fast_forward = false,
Key::LEFT => move_left = false,
Key::RIGHT => move_right = false,
_ => {}
},
_ => {}
},
None => break,
Event::KeyReleased {
code,
alt: _,
ctrl: _,
shift: _,
system: _,
} => match code {
Key::DOWN => fast_forward = false,
Key::LEFT => move_left = false,
Key::RIGHT => move_right = false,
_ => {}
},
_ => {}
}
}
@ -297,8 +294,8 @@ fn main() {
if paused {
loop {
match window.wait_event() {
Some(event) => match event {
if let Some(event) = window.wait_event() {
match event {
Event::Closed | Event::KeyPressed {
code: Key::Q,
alt: _,
@ -332,7 +329,6 @@ fn main() {
},
_ => {}
}
_ => {}
}
}
}

Loading…
Cancel
Save