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:
andy.boot
2020-01-16 23:50:56 +00:00
parent 5541df6a73
commit b9c27f9838
2 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -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);
}
}