From d815bc089c37ac525f2ce6f381e758911b273922 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Tue, 7 Oct 2025 17:17:15 +0900 Subject: [PATCH] chore: fix nightly clippy --- dpi/src/lib.rs | 2 +- winit-core/src/cursor.rs | 2 +- winit-core/src/icon.rs | 2 +- winit-core/src/monitor.rs | 2 +- winit-core/src/window.rs | 11 +++-------- winit/src/lib.rs | 2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/dpi/src/lib.rs b/dpi/src/lib.rs index 1b236720..12389a7b 100644 --- a/dpi/src/lib.rs +++ b/dpi/src/lib.rs @@ -64,7 +64,7 @@ //! [points]: https://en.wikipedia.org/wiki/Point_(typography) //! [picas]: https://en.wikipedia.org/wiki/Pica_(typography) -#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))] +#![cfg_attr(docsrs, feature(doc_cfg), doc(auto_cfg(hide(doc, docsrs))))] #![cfg_attr(feature = "std", forbid(unsafe_code))] #![no_std] diff --git a/winit-core/src/cursor.rs b/winit-core/src/cursor.rs index 9acebd40..0a600cdd 100644 --- a/winit-core/src/cursor.rs +++ b/winit-core/src/cursor.rs @@ -8,7 +8,7 @@ use std::time::Duration; #[doc(inline)] pub use cursor_icon::CursorIcon; -use crate::as_any::{impl_dyn_casting, AsAny}; +use crate::as_any::AsAny; /// The maximum width and height for a cursor when using [`CustomCursorSource::from_rgba`]. pub const MAX_CURSOR_SIZE: u16 = 2048; diff --git a/winit-core/src/icon.rs b/winit-core/src/icon.rs index b4a1a516..115b259c 100644 --- a/winit-core/src/icon.rs +++ b/winit-core/src/icon.rs @@ -3,7 +3,7 @@ use std::ops::Deref; use std::sync::Arc; use std::{fmt, io, mem}; -use crate::as_any::{impl_dyn_casting, AsAny}; +use crate::as_any::AsAny; pub(crate) const PIXEL_SIZE: usize = mem::size_of::(); diff --git a/winit-core/src/monitor.rs b/winit-core/src/monitor.rs index f24e3888..d5a68cb4 100644 --- a/winit-core/src/monitor.rs +++ b/winit-core/src/monitor.rs @@ -13,7 +13,7 @@ use std::sync::Arc; use dpi::{PhysicalPosition, PhysicalSize}; -use crate::as_any::{impl_dyn_casting, AsAny}; +use crate::as_any::AsAny; /// Handle to a monitor. /// diff --git a/winit-core/src/window.rs b/winit-core/src/window.rs index 8cd6116b..ae2b28ba 100644 --- a/winit-core/src/window.rs +++ b/winit-core/src/window.rs @@ -1601,17 +1601,18 @@ pub enum WindowLevel { /// The purpose should reflect the kind of data to be entered. /// The purpose may improve UX by optimizing the IME for the specific use case, /// for example showing relevant characters and hiding unneeded ones, -/// or changing the icon of the confrirmation button, +/// or changing the icon of the confirmation button, /// if winit can express the purpose to the platform and the platform reacts accordingly. /// /// ## Platform-specific /// /// - **iOS / Android / Web / Windows / X11 / macOS / Orbital:** Unsupported. #[non_exhaustive] -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] +#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Default)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub enum ImePurpose { /// No special purpose for the IME (default). + #[default] Normal, /// The IME is used for password input. /// The IME will treat the contents as sensitive. @@ -1638,12 +1639,6 @@ pub enum ImePurpose { DateTime, } -impl Default for ImePurpose { - fn default() -> Self { - Self::Normal - } -} - bitflags! { /// IME hints /// diff --git a/winit/src/lib.rs b/winit/src/lib.rs index a10da9ad..beb5c809 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -278,7 +278,7 @@ #![cfg_attr(clippy, deny(warnings))] // Doc feature labels can be tested locally by running RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly // doc -#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))] +#![cfg_attr(docsrs, feature(doc_cfg), doc(auto_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.