clippy: use matches!

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-01-19 11:08:10 +01:00
parent 6334bdc1c5
commit a6bd669854
4 changed files with 6 additions and 18 deletions

View File

@ -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 { .. })
}
}