From 65eecde2446495c0ea88c37318ead66457c7ab81 Mon Sep 17 00:00:00 2001 From: Matt Fellenz Date: Wed, 26 Jul 2023 10:07:05 -0700 Subject: [PATCH] Use cfg attribute (#3113) --- crates/eframe/src/native/run.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/eframe/src/native/run.rs b/crates/eframe/src/native/run.rs index 367daea7..7771265a 100644 --- a/crates/eframe/src/native/run.rs +++ b/crates/eframe/src/native/run.rs @@ -144,11 +144,13 @@ fn run_and_return( // Platform-dependent event handlers to workaround a winit bug // See: https://github.com/rust-windowing/winit/issues/987 // See: https://github.com/rust-windowing/winit/issues/1619 - winit::event::Event::RedrawEventsCleared if cfg!(windows) => { + #[cfg(windows)] + winit::event::Event::RedrawEventsCleared => { next_repaint_time = extremely_far_future(); winit_app.run_ui_and_paint() } - winit::event::Event::RedrawRequested(_) if !cfg!(windows) => { + #[cfg(not(windows))] + winit::event::Event::RedrawRequested(_) => { next_repaint_time = extremely_far_future(); winit_app.run_ui_and_paint() }