diff --git a/src/host/mod.rs b/src/host/mod.rs index 1061079..481bcba 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -543,10 +543,9 @@ impl Localhost { }), false => { // Is File - let extension: Option = match path.extension() { - Some(s) => Some(String::from(s.to_str().unwrap_or(""))), - None => None, - }; + let extension: Option = path + .extension() + .map(|s| String::from(s.to_str().unwrap_or(""))); FsEntry::File(FsFile { name: file_name, abs_path: path.clone(),