Apply clippy suggestions

This commit is contained in:
Danilo Bargen 2024-06-10 23:28:22 +02:00
commit 64f3fbbbc6
2 changed files with 5 additions and 6 deletions

View file

@ -314,9 +314,8 @@ impl Cache {
// specific and common page directories, but not others.
let should_walk = |entry: &DirEntry| -> bool {
let file_type = entry.file_type();
let file_name = match entry.file_name().to_str() {
Some(name) => name,
None => return false,
let Some(file_name) = entry.file_name().to_str() else {
return false;
};
if file_type.is_dir() {
return file_name == "common" || platform_dirs.contains(&file_name);

View file

@ -82,17 +82,17 @@ impl PlatformType {
Self::Android
}
#[cfg(any(target_os = "freebsd"))]
#[cfg(target_os = "freebsd")]
pub fn current() -> Self {
Self::FreeBsd
}
#[cfg(any(target_os = "netbsd"))]
#[cfg(target_os = "netbsd")]
pub fn current() -> Self {
Self::NetBsd
}
#[cfg(any(target_os = "openbsd"))]
#[cfg(target_os = "openbsd")]
pub fn current() -> Self {
Self::OpenBsd
}