From ed4d70fdd415aa4185c7f6e4e8dbd1052e8dca65 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Sun, 6 Apr 2025 15:41:46 +0900 Subject: [PATCH] chore: fix clippy issues --- src/lib.rs | 2 ++ src/platform/pump_events.rs | 20 ++++++++++---------- src/platform_impl/apple/uikit/app_state.rs | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 31edbb39..2a11bd6e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -288,6 +288,8 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))] #![allow(clippy::missing_safety_doc)] #![warn(clippy::uninlined_format_args)] +// TODO: wasm-binding needs to be updated for that to be resolved, for now just silence it. +#![cfg_attr(web_platform, allow(unknown_lints, wasm_c_abi))] // Re-export DPI types so that users don't have to put it in Cargo.toml. #[doc(inline)] diff --git a/src/platform/pump_events.rs b/src/platform/pump_events.rs index 4d070fea..2932284c 100644 --- a/src/platform/pump_events.rs +++ b/src/platform/pump_events.rs @@ -47,19 +47,19 @@ pub trait EventLoopExtPumpEvents { /// buffered and handled outside of Winit include: /// - `RedrawRequested` events, used to schedule rendering. /// - /// macOS for example uses a `drawRect` callback to drive rendering - /// within applications and expects rendering to be finished before - /// the `drawRect` callback returns. + /// macOS for example uses a `drawRect` callback to drive rendering + /// within applications and expects rendering to be finished before + /// the `drawRect` callback returns. /// - /// For portability it's strongly recommended that applications should - /// keep their rendering inside the closure provided to Winit. + /// For portability it's strongly recommended that applications should + /// keep their rendering inside the closure provided to Winit. /// - Any lifecycle events, such as `Suspended` / `Resumed`. /// - /// The handling of these events needs to be synchronized with the - /// operating system and it would never be appropriate to buffer a - /// notification that your application has been suspended or resumed and - /// then handled that later since there would always be a chance that - /// other lifecycle events occur while the event is buffered. + /// The handling of these events needs to be synchronized with the + /// operating system and it would never be appropriate to buffer a + /// notification that your application has been suspended or resumed and + /// then handled that later since there would always be a chance that + /// other lifecycle events occur while the event is buffered. /// /// ## Supported Platforms /// diff --git a/src/platform_impl/apple/uikit/app_state.rs b/src/platform_impl/apple/uikit/app_state.rs index ca497cb5..efdc7c5b 100644 --- a/src/platform_impl/apple/uikit/app_state.rs +++ b/src/platform_impl/apple/uikit/app_state.rs @@ -298,7 +298,7 @@ pub(crate) fn queue_gl_or_metal_redraw(mtm: MainThreadMarker, window: Retained bug!("unexpected state {:?}", s), + | s @ &mut AppStateImpl::PollFinished => bug!("unexpected state {:?}", s), &mut AppStateImpl::Terminated => { panic!("Attempt to create a `Window` after the app has terminated") },