diff --git a/Cargo.toml b/Cargo.toml index e63b41e..0f6806a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ fastrand = "1.4.0" base64 = "0.13.0" futures-lite = "1.11.1" async-channel = "1.5.1" -infer = "0.2.3" +infer = "0.7.0" pin-project-lite = "0.2.0" url = "2.1.1" anyhow = "1.0.26" diff --git a/src/mime/mod.rs b/src/mime/mod.rs index 8aa3b03..f416de3 100644 --- a/src/mime/mod.rs +++ b/src/mime/mod.rs @@ -44,10 +44,10 @@ impl Mime { pub fn sniff(bytes: &[u8]) -> crate::Result { let info = Infer::new(); let mime = match info.get(bytes) { - Some(info) => info.mime, + Some(info) => info.mime_type(), None => crate::bail!("Could not sniff the mime type"), }; - Mime::from_str(&mime) + Mime::from_str(mime) } /// Guess the mime type from a file extension