From de3368224201bbdc5b9aeec0e19a50fcd6e6d2ca Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 14 Nov 2026 04:46:07 +0000 Subject: [PATCH] Build: collapse the nested if in images tone (clippy) --- crates/images/src/tone.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/images/src/tone.rs b/crates/images/src/tone.rs index b5db792bb..0ec3f4da8 100644 --- a/crates/images/src/tone.rs +++ b/crates/images/src/tone.rs @@ -13,10 +13,10 @@ pub enum Tone { /// The [`Tone`] of an image file, `None` when a swatch doesn't colour it. pub fn tone(bytes: &[u8]) -> Option { - if let Some(info) = craft_image_codecs::inspect_raster(bytes).ok().flatten() { - if info.channels > 1 { - return None; - } + if let Some(info) = craft_image_codecs::inspect_raster(bytes).ok().flatten() + && info.channels > 1 + { + return None; } match craft_image_codecs::classify_tone(bytes)? { craft_image_codecs::ToneClass::Bitmap => Some(Tone::Bitmap),