Bladeren bron

Do not attempt to print nothing

This fixes a bug where an extra header line was printed when in --long --grid mode.
Benjamin Sago 10 jaren geleden
bovenliggende
commit
6cf9274828
1 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  1. 5 3
      src/main.rs

+ 5 - 3
src/main.rs

@@ -70,11 +70,13 @@ impl Exa {
             }
         }
 
-        let any_files = files.is_empty();
-        self.print_files(None, files);
+        let no_files = files.is_empty();
+        if !no_files {
+            self.print_files(None, files);
+        }
 
         let is_only_dir = dirs.len() == 1;
-        self.print_dirs(dirs, any_files, is_only_dir);
+        self.print_dirs(dirs, no_files, is_only_dir);
     }
 
     fn print_dirs(&self, dir_files: Vec<Dir>, mut first: bool, is_only_dir: bool) {