From db5a1f6353b9f8520c4f9633d1cdc90242c2afe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 19 Sep 2025 18:22:45 +0200 Subject: [PATCH] Fix `clippy` lints for Rust 1.90 --- core/src/window/icon.rs | 2 +- wgpu/src/lib.rs | 2 +- widget/src/text_editor.rs | 3 +-- widget/src/text_input.rs | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/window/icon.rs b/core/src/window/icon.rs index fb34ca32..fe4a7083 100644 --- a/core/src/window/icon.rs +++ b/core/src/window/icon.rs @@ -11,7 +11,7 @@ pub fn from_rgba( ) -> Result { const PIXEL_SIZE: usize = mem::size_of::() * 4; - if rgba.len() % PIXEL_SIZE != 0 { + if !rgba.len().is_multiple_of(PIXEL_SIZE) { return Err(Error::ByteCountNotDivisibleBy4 { byte_count: rgba.len(), }); diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 3d8ee265..f31457a7 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -797,7 +797,7 @@ impl graphics::mesh::Renderer for Renderer { ); debug_assert!( - mesh.indices().len() % 3 == 0, + mesh.indices().len().is_multiple_of(3), "Mesh indices length must be a multiple of 3" ); diff --git a/widget/src/text_editor.rs b/widget/src/text_editor.rs index 33666935..45622257 100644 --- a/widget/src/text_editor.rs +++ b/widget/src/text_editor.rs @@ -535,8 +535,7 @@ impl Focus { self.is_window_focused && ((self.now - self.updated_at).as_millis() / Self::CURSOR_BLINK_INTERVAL_MILLIS) - % 2 - == 0 + .is_multiple_of(2) } } diff --git a/widget/src/text_input.rs b/widget/src/text_input.rs index c385b34b..4cdd1d2d 100644 --- a/widget/src/text_input.rs +++ b/widget/src/text_input.rs @@ -515,8 +515,7 @@ where let is_cursor_visible = !is_disabled && ((focus.now - focus.updated_at).as_millis() / CURSOR_BLINK_INTERVAL_MILLIS) - % 2 - == 0; + .is_multiple_of(2); let cursor = if is_cursor_visible { Some((