From 121ce7479385e99a1531ef6bbd7a4c6788d663bb Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Wed, 4 Dec 2024 17:31:10 +0100 Subject: [PATCH] Fix lints --- crates/egui_extras/src/image.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/egui_extras/src/image.rs b/crates/egui_extras/src/image.rs index 17d6f6780ed..1d2f6afa480 100644 --- a/crates/egui_extras/src/image.rs +++ b/crates/egui_extras/src/image.rs @@ -190,8 +190,6 @@ impl RetainedImage { // ---------------------------------------------------------------------------- -use egui::load::LoadError; - /// Load a (non-svg) image. /// /// Requires the "image" feature. You must also opt-in to the image formats you need @@ -200,16 +198,18 @@ use egui::load::LoadError; /// # Errors /// On invalid image or unsupported image format. #[cfg(feature = "image")] -pub fn load_image_bytes(image_bytes: &[u8]) -> Result { +pub fn load_image_bytes(image_bytes: &[u8]) -> Result { crate::profile_function!(); let image = image::load_from_memory(image_bytes).map_err(|err| match err { image::ImageError::Unsupported(err) => match err.kind() { - image::error::UnsupportedErrorKind::Format(format) => LoadError::FormatNotSupported { - detected_format: Some(format.to_string()), - }, - _ => LoadError::Loading(err.to_string()), + image::error::UnsupportedErrorKind::Format(format) => { + egui::load::LoadError::FormatNotSupported { + detected_format: Some(format.to_string()), + } + } + _ => egui::load::LoadError::Loading(err.to_string()), }, - err => LoadError::Loading(err.to_string()), + err => egui::load::LoadError::Loading(err.to_string()), })?; let size = [image.width() as _, image.height() as _]; let image_buffer = image.to_rgba8();