We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2d3e391 + 3d904e6 commit 0b60560Copy full SHA for 0b60560
Cargo.toml
@@ -31,7 +31,7 @@ fastrand = "1.4.0"
31
base64 = "0.13.0"
32
futures-lite = "1.11.1"
33
async-channel = "1.5.1"
34
-infer = "0.2.3"
+infer = "0.7.0"
35
pin-project-lite = "0.2.0"
36
url = "2.1.1"
37
anyhow = "1.0.26"
src/mime/mod.rs
@@ -44,10 +44,10 @@ impl Mime {
44
pub fn sniff(bytes: &[u8]) -> crate::Result<Self> {
45
let info = Infer::new();
46
let mime = match info.get(bytes) {
47
- Some(info) => info.mime,
+ Some(info) => info.mime_type(),
48
None => crate::bail!("Could not sniff the mime type"),
49
};
50
- Mime::from_str(&mime)
+ Mime::from_str(mime)
51
}
52
53
/// Guess the mime type from a file extension
0 commit comments