diff options
author | 2024-02-07 19:42:55 +0100 | |
---|---|---|
committer | 2024-02-07 19:42:55 +0100 | |
commit | a631f4d745848289a45c539191b8377e2e8e7c01 (patch) | |
tree | ffc246d652d036b0189824da99932c3c7276e1fb /winit/src/application.rs | |
parent | 518ec52ebd2001e26cd68f513432a7caed11c373 (diff) | |
download | iced-a631f4d745848289a45c539191b8377e2e8e7c01.tar.gz iced-a631f4d745848289a45c539191b8377e2e8e7c01.tar.bz2 iced-a631f4d745848289a45c539191b8377e2e8e7c01.zip |
Remove `allow(unused_mut)` in `winit::application`
Diffstat (limited to 'winit/src/application.rs')
-rw-r--r-- | winit/src/application.rs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs index 52cf7fe8..77e2c83e 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -213,8 +213,7 @@ where let mut context = task::Context::from_waker(task::noop_waker_ref()); - #[allow(unused_mut)] - let mut process_event = + let process_event = move |event, event_loop: &winit::event_loop::EventLoopWindowTarget<_>| { if event_loop.exiting() { return; @@ -244,20 +243,24 @@ where // since the event loop does not resume during resize interaction. // More details: https://github.com/rust-windowing/winit/issues/3272 #[cfg(target_os = "windows")] - let _ = event_loop.run(move |event, event_loop| { - if matches!( - event, - winit::event::Event::WindowEvent { - event: winit::event::WindowEvent::Resized(_), - .. + { + let mut process_event = process_event; + + let _ = event_loop.run(move |event, event_loop| { + if matches!( + event, + winit::event::Event::WindowEvent { + event: winit::event::WindowEvent::Resized(_), + .. + } + ) { + process_event(event, event_loop); + process_event(winit::event::Event::AboutToWait, event_loop); + } else { + process_event(event, event_loop); } - ) { - process_event(event, event_loop); - process_event(winit::event::Event::AboutToWait, event_loop); - } else { - process_event(event, event_loop); - } - }); + }); + } Ok(()) } |