From 63e386017990b2ad24e216ec308e7d4b07715f71 Mon Sep 17 00:00:00 2001 From: Javier Feliz Date: Sat, 6 Sep 2025 01:05:33 -0400 Subject: [PATCH] More clippy fixes --- waycast-gtk/src/main.rs | 11 ++--------- waycast-gtk/src/ui/gtk/mod.rs | 12 +++++------- waycast-gtk/src/util/files.rs | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/waycast-gtk/src/main.rs b/waycast-gtk/src/main.rs index 6494d8a..50ade74 100644 --- a/waycast-gtk/src/main.rs +++ b/waycast-gtk/src/main.rs @@ -5,7 +5,6 @@ use gtk::prelude::*; use gtk::Application; use ui::gtk::GtkLauncherUI; use waycast_core::WaycastLauncher; -use waycast_plugins; fn main() { let app = Application::builder() @@ -15,16 +14,10 @@ fn main() { app.connect_activate(|app| { let mut file_search_plugin = waycast_plugins::file_search::new(); - match file_search_plugin.add_search_path("/home/javi/working-files/DJ Music/") { - Err(e) => eprintln!("{}", e), - _ => (), - } + if let Err(e) = file_search_plugin.add_search_path("/home/javi/working-files/DJ Music/") { eprintln!("{}", e) } let mut project_plugin = waycast_plugins::projects::new(); - match project_plugin.add_search_path("/home/javi/projects") { - Err(e) => eprintln!("{}", e), - _ => (), - } + if let Err(e) = project_plugin.add_search_path("/home/javi/projects") { eprintln!("{}", e) } // Create the core launcher let launcher = WaycastLauncher::new() diff --git a/waycast-gtk/src/ui/gtk/mod.rs b/waycast-gtk/src/ui/gtk/mod.rs index 396bd98..669d1ea 100644 --- a/waycast-gtk/src/ui/gtk/mod.rs +++ b/waycast-gtk/src/ui/gtk/mod.rs @@ -142,12 +142,10 @@ impl GtkLauncherUI { Image::from_icon_name("application-x-executable") } } + } else if let Some(default) = find_icon_file("vscode", "48", &icon_theme) { + image = gtk::Image::from_file(default); } else { - if let Some(default) = find_icon_file("vscode", "48", &icon_theme) { - image = gtk::Image::from_file(default); - } else { - image = Image::from_icon_name("application-x-executable"); - } + image = Image::from_icon_name("application-x-executable"); } image.set_pixel_size(icon_size); image.set_widget_name("item-icon"); @@ -428,7 +426,7 @@ fn find_icon_file( for cat in &categories { let path = base .join(icon_theme.theme_name()) - .join(if !(size == "scalable".to_string()) { + .join(if (size != "scalable") { format!("{}x{}", size, size) } else { size.to_string() @@ -446,7 +444,7 @@ fn find_icon_file( for cat in &categories { let path = base .join("hicolor") - .join(if !(size == "scalable".to_string()) { + .join(if (size != "scalable") { format!("{}x{}", size, size) } else { size.to_string() diff --git a/waycast-gtk/src/util/files.rs b/waycast-gtk/src/util/files.rs index 994363b..e3a404f 100644 --- a/waycast-gtk/src/util/files.rs +++ b/waycast-gtk/src/util/files.rs @@ -22,5 +22,5 @@ pub fn get_files_with_extension>( files.push(f); } - return Ok(files); + Ok(files) }