1
0
Эх сурвалжийг харах

refactor: Rename class FileExtension to FileTypeClassifier to better reflect the purpose

Robert Minsk 2 жил өмнө
parent
commit
baafbc44f3
1 өөрчлөгдсөн 5 нэмэгдсэн , 5 устгасан
  1. 5 5
      src/theme/mod.rs

+ 5 - 5
src/theme/mod.rs

@@ -66,7 +66,7 @@ impl Options {
 
     #[allow(trivial_casts)]   // the `as Box<_>` stuff below warns about this for some reason
     pub fn to_theme(&self, isatty: bool) -> Theme {
-        use crate::info::filetype::FileExtensions;
+        use crate::info::filetype::FileTypeClassifier;
 
         if self.use_colours == UseColours::Never || (self.use_colours == UseColours::Automatic && ! isatty) {
             let ui = UiStyles::plain();
@@ -80,10 +80,10 @@ impl Options {
 
         // Use between 0 and 2 file name highlighters
         let exts = match (exts.is_non_empty(), use_default_filetypes) {
-            (false, false)  => Box::new(NoFileColours)           as Box<_>,
-            (false,  true)  => Box::new(FileExtensions)          as Box<_>,
-            ( true, false)  => Box::new(exts)                    as Box<_>,
-            ( true,  true)  => Box::new((exts, FileExtensions))  as Box<_>,
+            (false, false)  => Box::new(NoFileColours)              as Box<_>,
+            (false,  true)  => Box::new(FileTypeClassifier)         as Box<_>,
+            ( true, false)  => Box::new(exts)                       as Box<_>,
+            ( true,  true)  => Box::new((exts, FileTypeClassifier)) as Box<_>,
         };
 
         Theme { ui, exts }