From 42a88b677cc5da70f71996f416c8fef76a8a79ed Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Tue, 25 Feb 2025 14:10:42 +0100 Subject: [PATCH] Fix some clippy lints from the future --- crates/ecolor/src/hex_color_runtime.rs | 5 +++-- crates/egui/src/containers/popup.rs | 2 +- crates/egui/src/containers/tooltip.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/ecolor/src/hex_color_runtime.rs b/crates/ecolor/src/hex_color_runtime.rs index 5b20258f..f817bf4b 100644 --- a/crates/ecolor/src/hex_color_runtime.rs +++ b/crates/ecolor/src/hex_color_runtime.rs @@ -90,14 +90,15 @@ impl HexColor { let [r, gb] = u16::from_str_radix(s, 16) .map_err(ParseHexColorError::InvalidInt)? .to_be_bytes(); - let [r, g, b] = [r, gb >> 4, gb & 0x0f].map(|u| u << 4 | u); + let [r, g, b] = [r, gb >> 4, gb & 0x0f].map(|u| (u << 4) | u); Ok(Self::Hex3(Color32::from_rgb(r, g, b))) } 4 => { let [r_g, b_a] = u16::from_str_radix(s, 16) .map_err(ParseHexColorError::InvalidInt)? .to_be_bytes(); - let [r, g, b, a] = [r_g >> 4, r_g & 0x0f, b_a >> 4, b_a & 0x0f].map(|u| u << 4 | u); + let [r, g, b, a] = + [r_g >> 4, r_g & 0x0f, b_a >> 4, b_a & 0x0f].map(|u| (u << 4) | u); Ok(Self::Hex4(Color32::from_rgba_unmultiplied(r, g, b, a))) } 6 => { diff --git a/crates/egui/src/containers/popup.rs b/crates/egui/src/containers/popup.rs index 76f67b05..4cb41b93 100644 --- a/crates/egui/src/containers/popup.rs +++ b/crates/egui/src/containers/popup.rs @@ -118,7 +118,7 @@ enum OpenKind<'a> { }, } -impl<'a> OpenKind<'a> { +impl OpenKind<'_> { /// Returns `true` if the popup should be open fn is_open(&self, id: Id, ctx: &Context) -> bool { match self { diff --git a/crates/egui/src/containers/tooltip.rs b/crates/egui/src/containers/tooltip.rs index 1cfc2a9c..c85739d7 100644 --- a/crates/egui/src/containers/tooltip.rs +++ b/crates/egui/src/containers/tooltip.rs @@ -11,7 +11,7 @@ pub struct Tooltip<'a> { widget_id: Id, } -impl<'a> Tooltip<'a> { +impl Tooltip<'_> { /// Show a tooltip that is always open pub fn new( widget_id: Id,