Fix some clippy lints from the future

This commit is contained in:
Emil Ernerfeldt 2025-02-25 14:10:42 +01:00
parent 6a96612cb3
commit 42a88b677c
3 changed files with 5 additions and 4 deletions

View File

@ -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 => {

View File

@ -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 {

View File

@ -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,