diff --git a/pixel_bridge/rust/image.rs b/pixel_bridge/rust/image.rs index 4d64124..b62c201 100644 --- a/pixel_bridge/rust/image.rs +++ b/pixel_bridge/rust/image.rs @@ -163,6 +163,7 @@ pub enum PixelType { F32, } +#[doc(hidden)] impl From for PixelType { fn from(value: RustColorType) -> Self { match value { @@ -204,6 +205,7 @@ pub struct Strides { pub channels: usize, } +#[doc(hidden)] impl From for ColorType { fn from(value: RustColorType) -> Self { match value { diff --git a/pixel_bridge/rust/reader.rs b/pixel_bridge/rust/reader.rs index dbdb698..1d18b16 100644 --- a/pixel_bridge/rust/reader.rs +++ b/pixel_bridge/rust/reader.rs @@ -48,9 +48,9 @@ pub enum Format { Ico, } -impl From for ImageFormat { - fn from(value: Format) -> ImageFormat { - match value { +impl Format { + fn to_image_format(self) -> ImageFormat { + match self { Format::Png => ImageFormat::Png, Format::Jpeg => ImageFormat::Jpeg, Format::Gif => ImageFormat::Gif, @@ -96,7 +96,7 @@ impl ImageReader { let Some(ref mut inner) = self.inner else { return; }; - inner.set_format(format.into()) + inner.set_format(format.to_image_format()) } /// Read the image.