cargo fmt

This commit is contained in:
Joakim Hulthe
2026-04-14 14:37:17 +00:00
parent 17c540a7d4
commit 0d8042287c

View File

@@ -66,10 +66,9 @@ impl ThumbnailResponse {
/// ``` /// ```
pub fn decode(&self) -> Result<image::DynamicImage> { pub fn decode(&self) -> Result<image::DynamicImage> {
// Get image format from content type // Get image format from content type
let format = image::ImageFormat::from_mime_type(&self.content_type) let format = image::ImageFormat::from_mime_type(&self.content_type).ok_or_else(|| {
.ok_or_else(|| ImmichError::Image( ImmichError::Image(format!("Unsupported content type: {}", self.content_type))
format!("Unsupported content type: {}", self.content_type) })?;
))?;
// Create reader with the format and decode // Create reader with the format and decode
image::ImageReader::with_format(Cursor::new(&self.data), format) image::ImageReader::with_format(Cursor::new(&self.data), format)