Fix compiler warning of potential undefined behavior (#892)

This commit is contained in:
Osspial 2019-05-30 20:42:53 -04:00 committed by GitHub
parent 08f8f89702
commit 0eefa3ba42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -844,13 +844,14 @@ unsafe extern "system" fn public_window_callback<T>(
// 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 => {