clippy: use matches!
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -137,18 +137,12 @@ impl DirEntry {
|
||||
|
||||
/// Check if DirEntry is a directory
|
||||
pub fn is_directory(&self) -> bool {
|
||||
match self.attr {
|
||||
DirEntryAttribute::Directory { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self.attr, DirEntryAttribute::Directory { .. })
|
||||
}
|
||||
|
||||
/// Check if DirEntry is a symlink
|
||||
pub fn is_symlink(&self) -> bool {
|
||||
match self.attr {
|
||||
DirEntryAttribute::Symlink { .. } => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self.attr, DirEntryAttribute::Symlink { .. })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -546,7 +546,7 @@ impl DataStore {
|
||||
}
|
||||
|
||||
pub fn garbage_collection_running(&self) -> bool {
|
||||
if let Ok(_) = self.gc_mutex.try_lock() { false } else { true }
|
||||
!matches!(self.gc_mutex.try_lock(), Ok(_))
|
||||
}
|
||||
|
||||
pub fn garbage_collection(&self, worker: &dyn TaskState, upid: &UPID) -> Result<(), Error> {
|
||||
|
Reference in New Issue
Block a user