From 2aa195f86abda158687bf6d8e4faaab5b4459fa7 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:50:05 +0900 Subject: [PATCH] Update image_loader.rs --- crates/egui_extras/src/loaders/image_loader.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/egui_extras/src/loaders/image_loader.rs b/crates/egui_extras/src/loaders/image_loader.rs index 8c2c497058a..c7bbfbc2fd4 100644 --- a/crates/egui_extras/src/loaders/image_loader.rs +++ b/crates/egui_extras/src/loaders/image_loader.rs @@ -19,7 +19,7 @@ impl ImageCrateLoader { } fn is_supported_uri(uri: &str) -> bool { - let Some(ext) = Path::new(uri).extension().and_then(|ext| ext.to_str()) else { + let Some(_ext) = Path::new(uri).extension().and_then(|ext| ext.to_str()) else { // `true` because if there's no extension, assume that we support it return true; }; @@ -28,7 +28,7 @@ fn is_supported_uri(uri: &str) -> bool { ImageFormat::all() .filter(ImageFormat::reading_enabled) .flat_map(ImageFormat::extensions_str) - .any(|format_ext| ext == *format_ext) + .any(|format_ext| uri.contains(*format_ext)) } fn is_unsupported_mime(mime: &str) -> bool {