mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
get_filesystem returns Result instead of option
Removes unwrap and returns a Result instead of panicing if an invalid path is given. Previously if the flag: '-x' was provided with an argument of an invalid directory the code would crash here
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ pub fn get_dir_tree(
|
||||
fn get_allowed_filesystems(top_level_names: &HashSet<String>) -> Option<HashSet<u64>> {
|
||||
let mut limit_filesystems: HashSet<u64> = HashSet::new();
|
||||
for file_name in top_level_names.iter() {
|
||||
if let Some(a) = get_filesystem(file_name) {
|
||||
if let Ok(a) = get_filesystem(file_name) {
|
||||
limit_filesystems.insert(a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user