From 0eefa3ba428dd8988a27d791ccd59bad60d36529 Mon Sep 17 00:00:00 2001 From: Osspial Date: Thu, 30 May 2019 20:42:53 -0400 Subject: [PATCH] Fix compiler warning of potential undefined behavior (#892) --- src/platform_impl/windows/event_loop.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index 7fbde380..1d49060d 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -844,13 +844,14 @@ unsafe extern "system" fn public_window_callback( // spinning up a new event loop iteration. We do this because that's what the API // says to do. let control_flow = runner.control_flow; + let runner_state = runner.runner_state; let mut request_redraw = || { runner.call_event_handler(Event::WindowEvent { window_id: RootWindowId(WindowId(window)), event: RedrawRequested, }); }; - match runner.runner_state { + match runner_state { RunnerState::Idle(..) | RunnerState::DeferredNewEvents(..) => request_redraw(), RunnerState::HandlingEvents => {