1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 03:31:03 +02:00

refactor: fix a few pedantic clippy warnings

This commit is contained in:
Jake Stanger 2023-04-29 22:08:38 +01:00
parent 7f46cb4976
commit 38da59cd41
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
4 changed files with 16 additions and 17 deletions

View file

@ -29,13 +29,12 @@ pub fn find_desktop_file(app_id: &str) -> Option<PathBuf> {
for dir in dirs {
let mut walker = WalkDir::new(dir).max_depth(5).into_iter();
let entry = walker.find(|entry| match entry {
Ok(entry) => {
let entry = walker.find(|entry| {
entry.as_ref().map_or(false, |entry| {
let file_name = entry.file_name().to_string_lossy().to_lowercase();
let test_name = format!("{}.desktop", app_id.to_lowercase());
file_name == test_name
}
_ => false,
})
});
if let Some(Ok(entry)) = entry {