Remove window.id() match, simply nested matches with single if-let

This commit is contained in:
Marijn Suijten 2021-12-21 00:39:35 +01:00 committed by Benjamin Saunders
parent 5b53dd94cb
commit 9d36436a53

View file

@ -185,11 +185,8 @@ impl ExampleBase {
.run_return(|event, _, control_flow| {
*control_flow = ControlFlow::Wait;
f();
match event {
Event::WindowEvent {
ref event,
window_id,
} if window_id == self.window.id() => match event {
if let Event::WindowEvent {
event:
WindowEvent::CloseRequested
| WindowEvent::KeyboardInput {
input:
@ -199,10 +196,11 @@ impl ExampleBase {
..
},
..
} => *control_flow = ControlFlow::Exit,
_ => {}
},
_ => {}
..
} = event
{
*control_flow = ControlFlow::Exit
}
});
}