Skip to content

Commit

Permalink
gufo: Fix build without formats
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-h committed Jan 3, 2025
1 parent 4c9232a commit d8e3fff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gufo/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ impl Image {

pub fn into_inner(self) -> Vec<u8> {
match self {
#[cfg(feature = "jpeg")]
Self::Jpeg(jpeg) => jpeg.into_inner(),
#[cfg(feature = "png")]
Self::Png(png) => png.into_inner(),
}
}

pub fn dyn_metadata(&self) -> Box<&dyn ImageMetadata> {
match self {
Self::Png(png) => Box::new(png as &dyn ImageMetadata),
Self::Jpeg(jpeg) => Box::new(jpeg as &dyn ImageMetadata),
match *self {
#[cfg(feature = "png")]
Self::Png(ref png) => Box::new(png as &dyn ImageMetadata),
#[cfg(feature = "jpeg")]
Self::Jpeg(ref jpeg) => Box::new(jpeg as &dyn ImageMetadata),
}
}

Expand Down

0 comments on commit d8e3fff

Please sign in to comment.