Fix some clippy lints from the future
This commit is contained in:
parent
6a96612cb3
commit
42a88b677c
|
|
@ -90,14 +90,15 @@ impl HexColor {
|
||||||
let [r, gb] = u16::from_str_radix(s, 16)
|
let [r, gb] = u16::from_str_radix(s, 16)
|
||||||
.map_err(ParseHexColorError::InvalidInt)?
|
.map_err(ParseHexColorError::InvalidInt)?
|
||||||
.to_be_bytes();
|
.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)))
|
Ok(Self::Hex3(Color32::from_rgb(r, g, b)))
|
||||||
}
|
}
|
||||||
4 => {
|
4 => {
|
||||||
let [r_g, b_a] = u16::from_str_radix(s, 16)
|
let [r_g, b_a] = u16::from_str_radix(s, 16)
|
||||||
.map_err(ParseHexColorError::InvalidInt)?
|
.map_err(ParseHexColorError::InvalidInt)?
|
||||||
.to_be_bytes();
|
.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)))
|
Ok(Self::Hex4(Color32::from_rgba_unmultiplied(r, g, b, a)))
|
||||||
}
|
}
|
||||||
6 => {
|
6 => {
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ enum OpenKind<'a> {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> OpenKind<'a> {
|
impl OpenKind<'_> {
|
||||||
/// Returns `true` if the popup should be open
|
/// Returns `true` if the popup should be open
|
||||||
fn is_open(&self, id: Id, ctx: &Context) -> bool {
|
fn is_open(&self, id: Id, ctx: &Context) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ pub struct Tooltip<'a> {
|
||||||
widget_id: Id,
|
widget_id: Id,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Tooltip<'a> {
|
impl Tooltip<'_> {
|
||||||
/// Show a tooltip that is always open
|
/// Show a tooltip that is always open
|
||||||
pub fn new(
|
pub fn new(
|
||||||
widget_id: Id,
|
widget_id: Id,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue