mirror of https://github.com/http-rs/http-types
Merge pull request #397 from janbaudisch/update-infer
Update infer to 0.7.0
This commit is contained in:
commit
0b60560968
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue