Fix memofs clippy lints (#682)

The third in a series of PRs that aim to get CI passing
This commit is contained in:
Kenneth Loeffler
2023-06-30 11:04:04 -07:00
committed by GitHub
parent b7a1f82f56
commit 0dabd8a1f6
4 changed files with 20 additions and 5 deletions

View File

@@ -50,6 +50,12 @@ impl InMemoryFs {
}
}
impl Default for InMemoryFs {
fn default() -> Self {
Self::new()
}
}
#[derive(Debug)]
struct InMemoryFsInner {
entries: HashMap<PathBuf, Entry>,

View File

@@ -194,11 +194,8 @@ impl VfsInner {
}
fn commit_event(&mut self, event: &VfsEvent) -> io::Result<()> {
match event {
VfsEvent::Remove(path) => {
let _ = self.backend.unwatch(&path);
}
_ => {}
if let VfsEvent::Remove(path) = event {
let _ = self.backend.unwatch(path);
}
Ok(())

View File

@@ -74,3 +74,9 @@ impl VfsBackend for NoopBackend {
))
}
}
impl Default for NoopBackend {
fn default() -> Self {
Self::new()
}
}

View File

@@ -108,3 +108,9 @@ impl VfsBackend for StdBackend {
.map_err(|inner| io::Error::new(io::ErrorKind::Other, inner))
}
}
impl Default for StdBackend {
fn default() -> Self {
Self::new()
}
}