From ba80038f3dc33762ff7f18c2fffdd3632611ae72 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:24:08 +0900 Subject: [PATCH] `egui_extras`: Fix file mime from path (wrong feature name) (#4933) Fix: features "mime_guess" to "file" typo: 1 Is this what you intended? If you intended to add `mime_guess` to `cargo.toml`, please drop it. --- crates/egui/src/data/input.rs | 2 +- crates/egui_extras/src/loaders/file_loader.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/egui/src/data/input.rs b/crates/egui/src/data/input.rs index 3bc88037..43fa9b66 100644 --- a/crates/egui/src/data/input.rs +++ b/crates/egui/src/data/input.rs @@ -719,7 +719,7 @@ impl Modifiers { } /// Checks that the `ctrl/cmd` matches, and that the `shift/alt` of the argument is a subset - /// of the pressed ksey (`self`). + /// of the pressed key (`self`). /// /// This means that if the pattern has not set `shift`, then `self` can have `shift` set or not. /// diff --git a/crates/egui_extras/src/loaders/file_loader.rs b/crates/egui_extras/src/loaders/file_loader.rs index b90cff95..5d1b45fb 100644 --- a/crates/egui_extras/src/loaders/file_loader.rs +++ b/crates/egui_extras/src/loaders/file_loader.rs @@ -80,12 +80,12 @@ impl BytesLoader for FileLoader { move || { let result = match std::fs::read(&path) { Ok(bytes) => { - #[cfg(feature = "mime_guess")] + #[cfg(feature = "file")] let mime = mime_guess2::from_path(&path) .first_raw() .map(|v| v.to_owned()); - #[cfg(not(feature = "mime_guess"))] + #[cfg(not(feature = "file"))] let mime = None; Ok(File {