From 6b1e1fe7b71916b9c783ed1103663100c40f27b7 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 10 Jun 2024 23:28:22 +0200 Subject: [PATCH] Apply clippy suggestions --- src/cache.rs | 5 ++--- src/types.rs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cache.rs b/src/cache.rs index 8fccb628..f5e604cf 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -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); diff --git a/src/types.rs b/src/types.rs index 06a8e644..8a111a65 100644 --- a/src/types.rs +++ b/src/types.rs @@ -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 }