Build: collapse the nested if in images tone (clippy)

This commit is contained in:
aiongg committed 2026-11-14 04:46:07 +00:00
1 parent 078f5994c4
commit de33682242
1 file changed
+4 -4
+4 -4
View File
@@ -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<Tone> {
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),