diff --git a/src/mime_db.rs b/src/mime_db.rs index 420c4dd..fde0531 100644 --- a/src/mime_db.rs +++ b/src/mime_db.rs @@ -18,6 +18,8 @@ cfg_if! { db: infer::Infer, } + // TODO: msi + fn open_document_check(buf: &[u8], kind: &str) -> bool { let mime = format!("application/vnd.oasis.opendocument.{}", kind); let mime = mime.as_bytes(); @@ -48,15 +50,7 @@ cfg_if! { info.add("audio/x-aiff", "aiff", |buf| { // as added by https://github.com/bojand/infer/pull/48/files // this should be removed when (if) that PR is accepted - buf.len() > 11 - && buf[0] == 0x46 - && buf[1] == 0x4F - && buf[2] == 0x52 - && buf[3] == 0x4D - && buf[8] == 0x41 - && buf[9] == 0x49 - && buf[10] == 0x46 - && buf[11] == 0x46 + buf.starts_with(b"\x46\x4f\x52\x4d\x41\x49\x46\x46") }); info.add("image/svg+xml", "svg", |buf| {