diff --git a/src/fs/feature/xattr.rs b/src/fs/feature/xattr.rs index acf3098..30343c7 100644 --- a/src/fs/feature/xattr.rs +++ b/src/fs/feature/xattr.rs @@ -1,7 +1,6 @@ //! Extended attribute support for Darwin and Linux systems. #![allow(trivial_casts)] // for ARM -extern crate libc; use std::cmp::Ordering; use std::io; diff --git a/src/fs/filter.rs b/src/fs/filter.rs index a902798..4cd6ad2 100644 --- a/src/fs/filter.rs +++ b/src/fs/filter.rs @@ -91,7 +91,7 @@ pub struct FileFilter { impl FileFilter { /// Remove every file in the given vector that does *not* pass the /// filter predicate for files found inside a directory. - pub fn filter_child_files(&self, files: &mut Vec) { + pub fn filter_child_files(&self, files: &mut Vec>) { files.retain(|f| ! self.ignore_patterns.is_ignored(&f.name)); if self.only_dirs { @@ -108,7 +108,7 @@ impl FileFilter { /// dotfile, because it’s been directly specified. But running /// `exa -I='*.ogg' music/*` should filter out the ogg files obtained /// from the glob, even though the globbing is done by the shell! - pub fn filter_argument_files(&self, files: &mut Vec) { + pub fn filter_argument_files(&self, files: &mut Vec>) { files.retain(|f| { ! self.ignore_patterns.is_ignored(&f.name) }); @@ -240,7 +240,7 @@ impl SortField { /// into groups between letters and numbers, and then sorts those blocks /// together, so `file10` will sort after `file9`, instead of before it /// because of the `1`. - pub fn compare_files(self, a: &File, b: &File) -> Ordering { + pub fn compare_files(self, a: &File<'_>, b: &File<'_>) -> Ordering { use self::SortCase::{ABCabc, AaBbCc}; match self { diff --git a/src/info/filetype.rs b/src/info/filetype.rs index a23a39f..56fa8c4 100644 --- a/src/info/filetype.rs +++ b/src/info/filetype.rs @@ -19,7 +19,7 @@ impl FileExtensions { /// An “immediate” file is something that can be run or activated somehow /// in order to kick off the build of a project. It’s usually only present /// in directories full of source code. - fn is_immediate(&self, file: &File) -> bool { + fn is_immediate(&self, file: &File<'_>) -> bool { file.name.to_lowercase().starts_with("readme") || file.name.ends_with(".ninja") || file.name_is_one_of( &[ @@ -30,7 +30,7 @@ impl FileExtensions { ]) } - fn is_image(&self, file: &File) -> bool { + fn is_image(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "png", "jpeg", "jpg", "gif", "bmp", "tiff", "tif", "ppm", "pgm", "pbm", "pnm", "webp", "raw", "arw", @@ -39,33 +39,33 @@ impl FileExtensions { ]) } - fn is_video(&self, file: &File) -> bool { + fn is_video(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "avi", "flv", "m2v", "m4v", "mkv", "mov", "mp4", "mpeg", "mpg", "ogm", "ogv", "vob", "wmv", "webm", "m2ts", ]) } - fn is_music(&self, file: &File) -> bool { + fn is_music(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "aac", "m4a", "mp3", "ogg", "wma", "mka", "opus", ]) } // Lossless music, rather than any other kind of data... - fn is_lossless(&self, file: &File) -> bool { + fn is_lossless(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "alac", "ape", "flac", "wav", ]) } - fn is_crypto(&self, file: &File) -> bool { + fn is_crypto(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "asc", "enc", "gpg", "pgp", "sig", "signature", "pfx", "p12", ]) } - fn is_document(&self, file: &File) -> bool { + fn is_document(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "djvu", "doc", "docx", "dvi", "eml", "eps", "fotd", "key", "keynote", "numbers", "odp", "odt", "pages", "pdf", "ppt", @@ -73,7 +73,7 @@ impl FileExtensions { ]) } - fn is_compressed(&self, file: &File) -> bool { + fn is_compressed(&self, file: &File<'_>) -> bool { file.extension_is_one_of( &[ "zip", "tar", "Z", "z", "gz", "bz2", "a", "ar", "7z", "iso", "dmg", "tc", "rar", "par", "tgz", "xz", "txz", @@ -81,13 +81,13 @@ impl FileExtensions { ]) } - fn is_temp(&self, file: &File) -> bool { + fn is_temp(&self, file: &File<'_>) -> bool { file.name.ends_with('~') || (file.name.starts_with('#') && file.name.ends_with('#')) || file.extension_is_one_of( &[ "tmp", "swp", "swo", "swn", "bak", "bk" ]) } - fn is_compiled(&self, file: &File) -> bool { + fn is_compiled(&self, file: &File<'_>) -> bool { if file.extension_is_one_of( &[ "class", "elc", "hi", "o", "pyc", "zwc", "ko" ]) { true } @@ -101,7 +101,7 @@ impl FileExtensions { } impl FileColours for FileExtensions { - fn colour_file(&self, file: &File) -> Option