From 6f6eeec0e7c1d61f3df714f806790302ad32eaf8 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Mon, 11 Mar 2024 10:37:30 -0400 Subject: [PATCH] fix: de fallback name check --- .github/workflows/ci.yml | 1 + src/desktop.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c308fbf6..c4993eb7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: - winit_wgpu - wayland - applet + - desktop runs-on: ubuntu-22.04 steps: - name: Checkout sources diff --git a/src/desktop.rs b/src/desktop.rs index ac7efb67..6895bc1a 100644 --- a/src/desktop.rs +++ b/src/desktop.rs @@ -86,10 +86,11 @@ pub fn load_applications_for_app_ids<'a, 'b>( app_ids.remove(i); true // Fallback: If the name matches... - } else if let Some(i) = app_ids - .iter() - .position(|id| id.to_lowercase().eq(&de.name().to_lowercase())) - { + } else if let Some(i) = app_ids.iter().position(|id| { + de.name(None) + .map(|n| n.to_lowercase() == id.to_lowercase()) + .unwrap_or_default() + }) { app_ids.remove(i); true } else { @@ -177,7 +178,7 @@ impl DesktopEntryData { .categories() .unwrap_or_default() .split_terminator(';') - .map(|x| x.to_string()) + .map(std::string::ToString::to_string) .collect(), desktop_actions: de .actions() @@ -235,5 +236,5 @@ where cmd.envs(env_vars); - crate::process::spawn(cmd) + crate::process::spawn(cmd); }