소스 검색

Remove unnecessary FileTypes trait

Ben S 10 년 전
부모
커밋
8ef316e1a4
2개의 변경된 파일1개의 추가작업 그리고 16개의 파일을 삭제
  1. 1 15
      src/filetype.rs
  2. 0 1
      src/output/mod.rs

+ 1 - 15
src/filetype.rs

@@ -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]

+ 0 - 1
src/output/mod.rs

@@ -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,