Skip to content

Commit

Permalink
Fix rust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley King committed Oct 24, 2023
1 parent 990b490 commit e794c0d
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl ImageFormat {
ImageFormat::Farbfeld => cfg!(feature = "farbfeld"),
ImageFormat::Avif => cfg!(feature = "avif"),
ImageFormat::Qoi => cfg!(feature = "qoi"),
ImageFormat::Dds => false
ImageFormat::Dds => false,
}
}

Expand All @@ -348,16 +348,31 @@ impl ImageFormat {
ImageFormat::OpenExr => cfg!(feature = "openexr"),
ImageFormat::Qoi => cfg!(feature = "qoi"),
ImageFormat::Dds => false,
ImageFormat::Hdr => false
ImageFormat::Hdr => false,
}
}

/// Return all ImageFormats
fn all() -> impl Iterator<Item=ImageFormat> {
[ImageFormat::Gif, ImageFormat::Ico, ImageFormat::Jpeg, ImageFormat::Png, ImageFormat::Bmp,
ImageFormat::Tiff, ImageFormat::Tga, ImageFormat::Pnm, ImageFormat::Farbfeld,
ImageFormat::Avif, ImageFormat::WebP, ImageFormat::OpenExr, ImageFormat::Qoi,
ImageFormat::Dds, ImageFormat::Hdr].iter().copied()
fn all() -> impl Iterator<Item = ImageFormat> {
[
ImageFormat::Gif,
ImageFormat::Ico,
ImageFormat::Jpeg,
ImageFormat::Png,
ImageFormat::Bmp,
ImageFormat::Tiff,
ImageFormat::Tga,
ImageFormat::Pnm,
ImageFormat::Farbfeld,
ImageFormat::Avif,
ImageFormat::WebP,
ImageFormat::OpenExr,
ImageFormat::Qoi,
ImageFormat::Dds,
ImageFormat::Hdr,
]
.iter()
.copied()
}
}

Expand Down

0 comments on commit e794c0d

Please sign in to comment.