diff --git a/src/files.rs b/src/files.rs index 2173bf6..d89c54c 100644 --- a/src/files.rs +++ b/src/files.rs @@ -6,7 +6,6 @@ use std::collections::{BTreeSet, HashMap}; use std::fs::File; use std::io::{self, Read, Seek, SeekFrom}; -use std::ops::Deref; use std::path::Path; use std::str::FromStr; @@ -284,11 +283,11 @@ pub fn mime_type(db: &T, path: &Path) -> io::Result> { // another is ZIP - many file formats (DOCX, ODT, JAR...) are just ZIP files with particular data structures. // determining that a file is in one of the MS office formats in particular requires looking quite far into the // file. - && mime != APPLICATION_ZIP.deref() + && mime != &*APPLICATION_ZIP // doc/ppt/xls files are a subset of what's known as an "OLE2 compound document storage", at least according to // shared-mime-info. if a pre-OOXML era MS office file is scanned and identified as x-ole-storage, reading further // will allow it to be detected correctly as the appropriate filetype. - && mime != APPLICATION_X_OLE_STORAGE.deref()); + && mime != &*APPLICATION_X_OLE_STORAGE); if r.is_some() { return Ok(r); diff --git a/src/tests/mod.rs b/src/tests/mod.rs index da39d42..3b77b09 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -4,7 +4,6 @@ use std::collections::{BTreeMap, HashMap}; use std::ffi::OsStr; -use std::ops::Deref; use std::path::{Path, PathBuf}; use clap::Clap; @@ -60,10 +59,10 @@ fn recommend_ext() { &IMAGE_JPEG => "jpg", &IMAGE_PNG => "png", &APPLICATION_PDF => "pdf", - APPLICATION_ZIP.deref() => "zip", + &*APPLICATION_ZIP => "zip", ]; - for (mime, ext) in tests.into_iter() { + for (mime, ext) in tests { assert!( mime_extension_lookup(mime.essence_str().into()) .unwrap() @@ -446,7 +445,7 @@ fn writables_is_correct() { assert_eq!( &["henlo".into(), Path::new("henlo").into(), Writable::Newline, Writable::Newline], writablesln!["henlo", (Path::new("henlo")), Newline] - ) + ); } #[test]