mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-14 14:22:39 +00:00
Build: collapse the nested if in images tone (clippy)
This commit is contained in:
1 parent
078f5994c4
commit
de33682242
1 file changed
+4
-4
@@ -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),
|
||||
|
||||
Reference in new issue
Block a user