Merge pull request #397 from janbaudisch/update-infer

Update infer to 0.7.0
This commit is contained in:
Yosh 2022-03-23 13:55:47 +01:00 committed by GitHub
commit 0b60560968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -44,10 +44,10 @@ impl Mime {
pub fn sniff(bytes: &[u8]) -> crate::Result<Self> {
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