Skip to content

Commit d14c956

Browse files
committed
Resolve new collapsible-match clippy lints in example runners
1 parent c14bd5b commit d14c956

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

examples/runners/ash/src/main.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,15 @@ pub fn main() -> anyhow::Result<()> {
202202
..
203203
} => match key {
204204
winit::keyboard::NamedKey::Escape => event_loop_window_target.exit(),
205-
winit::keyboard::NamedKey::F5 => {
206-
if !recompiling_shaders {
207-
recompiling_shaders = true;
208-
let compiler_sender = compiler_sender.clone();
209-
thread::spawn(move || {
210-
let shader_code = compile_shaders(&options.shader)
211-
.context("Compiling shaders failed")
212-
.unwrap();
213-
compiler_sender.try_send(shader_code).unwrap();
214-
});
215-
}
205+
winit::keyboard::NamedKey::F5 if !recompiling_shaders => {
206+
recompiling_shaders = true;
207+
let compiler_sender = compiler_sender.clone();
208+
thread::spawn(move || {
209+
let shader_code = compile_shaders(&options.shader)
210+
.context("Compiling shaders failed")
211+
.unwrap();
212+
compiler_sender.try_send(shader_code).unwrap();
213+
});
216214
}
217215
winit::keyboard::NamedKey::ArrowUp
218216
| winit::keyboard::NamedKey::ArrowDown => {

examples/runners/wgpu/src/graphics.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,12 @@ async fn run(
262262
Event::WindowEvent {
263263
event: WindowEvent::Resized(size),
264264
..
265-
} => {
266-
if size.width != 0 && size.height != 0 {
267-
// Recreate the swap chain with the new size
268-
if let Ok((surface, surface_config)) = &mut surface_with_config {
269-
surface_config.width = size.width;
270-
surface_config.height = size.height;
271-
surface.configure(&device, surface_config);
272-
}
265+
} if size.width != 0 && size.height != 0 => {
266+
// Recreate the swap chain with the new size
267+
if let Ok((surface, surface_config)) = &mut surface_with_config {
268+
surface_config.width = size.width;
269+
surface_config.height = size.height;
270+
surface.configure(&device, surface_config);
273271
}
274272
}
275273
Event::WindowEvent {

0 commit comments

Comments
 (0)