Просмотр исходного кода

fix: crash using --git-repos on unreadable dir

Added extra filter to make sure the other `unwrap()` also doesn't make `eza` crash.
Erwin van Eijk 2 лет назад
Родитель
Сommit
42396ba360
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      src/main.rs

+ 1 - 0
src/main.rs

@@ -204,6 +204,7 @@ fn get_files_in_dir(paths: &mut Vec<PathBuf>, path: PathBuf) {
                 vec![path]
             }
             Ok(d) => d
+                .filter(std::result::Result::is_ok)
                 .map(|entry| entry.unwrap().path())
                 .collect::<Vec<PathBuf>>(),
         }