From 88d6bf80f5cdbbb90ead197bd41a67eb8c44e50e Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Sat, 17 Jan 2026 11:22:22 +0100 Subject: Make clippy stricter and fix --- src/dialogs.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/dialogs.rs') diff --git a/src/dialogs.rs b/src/dialogs.rs index 8f5b951..41b8c86 100644 --- a/src/dialogs.rs +++ b/src/dialogs.rs @@ -94,7 +94,7 @@ pub fn show_open_dialog( /// Shows a file save dialog and handles the response. pub fn show_save_dialog( window: >k::Window, - current_file: Option, + current_file: Option<&PathBuf>, close_after: bool, sender: ComponentSender, ) { @@ -110,7 +110,7 @@ pub fn show_save_dialog( dialog.add_filter(&create_file_filter()); let default_filename = "map.wmap"; - if let Some(ref current_path) = current_file { + if let Some(current_path) = current_file { if let Some(parent) = current_path.parent() { let folder = gtk::gio::File::for_path(parent); dialog.set_current_folder(Some(&folder)).ok(); @@ -191,7 +191,7 @@ fn create_image_filter(format: ImageFormat) -> gtk::FileFilter { /// Shows an export image dialog and handles the response. pub fn show_export_dialog( window: >k::Window, - current_file: Option, + current_file: Option<&PathBuf>, sender: ComponentSender, ) { let dialog = gtk::FileChooserDialog::new( @@ -217,13 +217,13 @@ pub fn show_export_dialog( .unwrap_or("map") .to_string(); - if let Some(ref current_path) = current_file + if let Some(current_path) = current_file && let Some(parent) = current_path.parent() { let folder = gtk::gio::File::for_path(parent); dialog.set_current_folder(Some(&folder)).ok(); } - dialog.set_current_name(&format!("{}.png", base_name)); + dialog.set_current_name(&format!("{base_name}.png")); // Update extension when filter changes { @@ -235,7 +235,7 @@ pub fn show_export_dialog( } else { "svg" }; - dialog.set_current_name(&format!("{}.{}", base_name_clone, ext)); + dialog.set_current_name(&format!("{base_name_clone}.{ext}")); }); } -- cgit