1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

migrate to mime_guess2 (#3456)

This commit is contained in:
Clement Rey
2023-10-11 14:24:55 +02:00
committed by GitHub
parent b5e3502067
commit fd75adb3a0
3 changed files with 8 additions and 8 deletions

View File

@@ -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"]
@@ -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"]
@@ -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 }

View File

@@ -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());