Skip to content

Commit

Permalink
egui_extras: Fix file mime from path (wrong feature name) (#4933)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rustbasic authored Aug 26, 2024
1 parent a0c4e28 commit ba80038
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/egui/src/data/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
4 changes: 2 additions & 2 deletions crates/egui_extras/src/loaders/file_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ba80038

Please sign in to comment.