mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-09-27 20:59:02 +00:00
Remove unnecessary FileTypes trait
This commit is contained in:
parent
46593d3c2e
commit
8ef316e1a4
@ -1,20 +1,7 @@
|
||||
use file::File;
|
||||
|
||||
|
||||
pub trait FileTypes {
|
||||
fn is_immediate(&self) -> bool;
|
||||
fn is_image(&self) -> bool;
|
||||
fn is_video(&self) -> bool;
|
||||
fn is_music(&self) -> bool;
|
||||
fn is_lossless(&self) -> bool;
|
||||
fn is_crypto(&self) -> bool;
|
||||
fn is_document(&self) -> bool;
|
||||
fn is_compressed(&self) -> bool;
|
||||
fn is_temp(&self) -> bool;
|
||||
fn is_compiled(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<'_> FileTypes for File<'_> {
|
||||
impl<'_> File<'_> {
|
||||
fn is_immediate(&self) -> bool {
|
||||
self.name.starts_with("README") || self.name_is_one_of( &[
|
||||
"Makefile", "Cargo.toml", "SConstruct", "CMakeLists.txt",
|
||||
@ -95,7 +82,6 @@ impl<'_> FileTypes for File<'_> {
|
||||
|
||||
#[cfg(broken_test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use file::test::{dummy_stat, new_file};
|
||||
|
||||
#[test]
|
||||
|
@ -51,7 +51,6 @@ fn symlink_filename(file: File, colours: &Colours) -> TextCellContents {
|
||||
}
|
||||
|
||||
pub fn file_colour(colours: &Colours, file: &File) -> Style {
|
||||
use filetype::FileTypes;
|
||||
|
||||
match file {
|
||||
f if f.is_directory() => colours.filetypes.directory,
|
||||
|
Loading…
Reference in New Issue
Block a user