diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-03-30 13:39:24 +0200 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2026-03-30 13:45:00 +0200 |
| commit | 9b988989ec3dc1316c5bdfa162b6ef8cfd21beff (patch) | |
| tree | 0e7ce77dda423add1fc09f1dd2df2b3c2ee13478 /src/components/preferences_window.rs | |
| parent | d01a4df546b553128400f6c68eefa8368b4113a8 (diff) | |
Apply some linting
Diffstat (limited to 'src/components/preferences_window.rs')
| -rw-r--r-- | src/components/preferences_window.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/components/preferences_window.rs b/src/components/preferences_window.rs index ed18ba5..0fb7d63 100644 --- a/src/components/preferences_window.rs +++ b/src/components/preferences_window.rs @@ -139,10 +139,10 @@ impl SimpleComponent for PreferencesWindow { fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>) { match message { PreferencesAction::Export => { - Self::show_export_dialog(sender, &self.window); + Self::show_export_dialog(&sender, &self.window); } PreferencesAction::Import => { - Self::show_import_dialog(sender, &self.window); + Self::show_import_dialog(&sender, &self.window); } PreferencesAction::ImportFromFile(path) => { if storage::import_from_file(&mut self.preferences, &path).is_ok() { @@ -175,13 +175,15 @@ impl SimpleComponent for PreferencesWindow { self.save_and_notify(&sender); } PreferencesAction::SetCustomFontName(custom_font) => { - self.preferences.custom_font_name = custom_font.clone(); + self.preferences.custom_font_name.clone_from(&custom_font); self.map_page .emit(preference_pages::MapAction::SetCustomFont(custom_font)); self.save_and_notify(&sender); } PreferencesAction::SetDefaultExportFormat(default_export_format) => { - self.preferences.default_export_format = default_export_format.clone(); + self.preferences + .default_export_format + .clone_from(&default_export_format); self.map_page .emit(preference_pages::MapAction::SetDefaultExportFormat( default_export_format, @@ -205,7 +207,9 @@ impl SimpleComponent for PreferencesWindow { self.save_and_notify(&sender); } PreferencesAction::SetCustomEditorFontName(font_name) => { - self.preferences.custom_editor_font_name = font_name.clone(); + self.preferences + .custom_editor_font_name + .clone_from(&font_name); self.editor_page .emit(preference_pages::EditorAction::SetCustomFont(font_name)); self.save_and_notify(&sender); @@ -321,7 +325,7 @@ impl PreferencesWindow { .emit(preference_pages::TemplatesAction::UpdateAllTemplates( self.preferences.map_templates.clone(), )); - self.save_and_notify(&sender); + self.save_and_notify(sender); } fn handle_add_custom_stage(&mut self, sender: &ComponentSender<Self>) { @@ -402,7 +406,7 @@ impl PreferencesWindow { ); root.add_breakpoint(breakpoint); } - fn show_export_dialog(sender: ComponentSender<Self>, window: &adw::Window) { + fn show_export_dialog(sender: &ComponentSender<Self>, window: &adw::Window) { let filter = FileFilter::new(); filter.add_pattern("*.json"); filter.set_name(Some(&tr!("dialog.file_type.json"))); @@ -428,7 +432,7 @@ impl PreferencesWindow { }); } - fn show_import_dialog(sender: ComponentSender<Self>, window: &adw::Window) { + fn show_import_dialog(sender: &ComponentSender<Self>, window: &adw::Window) { let filter = FileFilter::new(); filter.add_pattern("*.json"); filter.set_name(Some(&tr!("dialog.file_type.json"))); |