Fix some more clippy lints.

This commit is contained in:
2025-02-23 11:58:52 +00:00
parent 7e62bdae35
commit 2be5b63af7
+12 -11
View File
@@ -14,6 +14,7 @@ pub enum Colour {
White = 0xFFFFFFFF,
}
#[allow(clippy::use_self)]
impl From<Colour> for u32 {
fn from(val: Colour) -> Self {
match val {
@@ -37,17 +38,17 @@ impl From<Colour> for u32 {
impl core::fmt::Display for Colour {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Colour::ARGB(r, g, b, a) => write!(f, "RGBA(#{:x}{:x}{:x}{:x})", r, g, b, a),
Colour::RGB(r, g, b) => write!(f, "RGB(#{:x}{:x}{:x})", r, g, b),
Colour::HexARGB(hex) => write!(f, "Hex(#{:x})", hex),
Colour::Black => write!(f, "Black"),
Colour::Blue => write!(f, "Blue"),
Colour::Green => write!(f, "Green"),
Colour::Cyan => write!(f, "Cyan"),
Colour::Red => write!(f, "Red"),
Colour::Magenta => write!(f, "Magenta"),
Colour::Yellow => write!(f, "Yellow"),
Colour::White => write!(f, "White"),
Self::ARGB(r, g, b, a) => write!(f, "RGBA(#{:x}{:x}{:x}{:x})", r, g, b, a),
Self::RGB(r, g, b) => write!(f, "RGB(#{:x}{:x}{:x})", r, g, b),
Self::HexARGB(hex) => write!(f, "Hex(#{:x})", hex),
Self::Black => write!(f, "Black"),
Self::Blue => write!(f, "Blue"),
Self::Green => write!(f, "Green"),
Self::Cyan => write!(f, "Cyan"),
Self::Red => write!(f, "Red"),
Self::Magenta => write!(f, "Magenta"),
Self::Yellow => write!(f, "Yellow"),
Self::White => write!(f, "White"),
}
}
}