error handling lol

This commit is contained in:
galister
2024-02-19 03:30:16 +01:00
parent 5d812c3b09
commit 0eebc206a2
6 changed files with 37 additions and 34 deletions

View File

@@ -128,10 +128,11 @@ pub fn load_general() -> GeneralConfig {
let path_conf_d = get_conf_d_path();
if let Ok(paths_unsorted) = std::fs::read_dir(path_conf_d) {
// Sort paths alphabetically
let mut paths: Vec<_> = paths_unsorted.map(|r| r.unwrap()).collect();
let mut paths: Vec<_> = paths_unsorted.map(|r| r.unwrap()).collect(); // TODO safe unwrap?
paths.sort_by_key(|dir| dir.path());
for path in paths {
if !path.file_type().unwrap().is_file() {
// TODO safe unwrap?
continue;
}