Skip to content

Commit

Permalink
migrate to mime_guess2 (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc authored Oct 11, 2023
1 parent b5e3502 commit fd75adb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/egui_extras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ all-features = true


[features]
default = ["dep:mime_guess"]
default = ["dep:mime_guess2"]

## Shorthand for enabling the different types of image loaders (`file`, `http`, `image`, `svg`).
all_loaders = ["file", "http", "image", "svg"]
Expand All @@ -33,7 +33,7 @@ all_loaders = ["file", "http", "image", "svg"]
datepicker = ["chrono"]

## Add support for loading images from `file://` URIs.
file = ["dep:mime_guess"]
file = ["dep:mime_guess2"]

## Add support for loading images via HTTP.
http = ["dep:ehttp"]
Expand Down Expand Up @@ -83,7 +83,7 @@ document-features = { version = "0.2", optional = true }
image = { version = "0.24", optional = true, default-features = false }

# file feature
mime_guess = { version = "2.0.4", optional = true, default-features = false }
mime_guess2 = { version = "2", optional = true, default-features = false }

puffin = { version = "0.16", optional = true }

Expand Down
2 changes: 1 addition & 1 deletion crates/egui_extras/src/loaders/file_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl BytesLoader for FileLoader {
let result = match std::fs::read(&path) {
Ok(bytes) => {
#[cfg(feature = "mime_guess")]
let mime = mime_guess::from_path(&path)
let mime = mime_guess2::from_path(&path)
.first_raw()
.map(|v| v.to_owned());

Expand Down

0 comments on commit fd75adb

Please sign in to comment.