Fixed clippy warnings (#90)

* Fixed clippy warnings

* Fix as per review
This commit is contained in:
boyned//Kampfkarren
2018-12-03 10:35:40 -08:00
committed by Lucien Greathouse
parent 26a7bb9746
commit 13a7c1ba81
7 changed files with 31 additions and 47 deletions

View File

@@ -108,13 +108,10 @@ impl Imfs {
}
}
match self.items.remove(path) {
Some(ImfsItem::Directory(directory)) => {
for child_path in &directory.children {
self.path_removed(child_path)?;
}
},
_ => {},
if let Some(ImfsItem::Directory(directory)) = self.items.remove(path) {
for child_path in &directory.children {
self.path_removed(child_path)?;
}
}
Ok(())
@@ -173,7 +170,7 @@ impl ImfsItem {
vfs.items.insert(path.to_path_buf(), item);
Ok(vfs.items.get(path).unwrap())
Ok(&vfs.items[path])
} else if metadata.is_dir() {
let mut children = HashSet::new();
@@ -193,7 +190,7 @@ impl ImfsItem {
vfs.items.insert(path.to_path_buf(), item);
Ok(vfs.items.get(path).unwrap())
Ok(&vfs.items[path])
} else {
panic!("Unexpected non-file, non-directory item");
}