From c2465ff46ea2503cf839efdd90ccc5174f84fbe8 Mon Sep 17 00:00:00 2001 From: Rubén Beltrán del Río Date: Thu, 26 Mar 2026 23:26:23 +0100 Subject: Address clippy issues --- src/components/footer.rs | 18 +++++++----------- src/components/header.rs | 24 +++++++++++------------- 2 files changed, 18 insertions(+), 24 deletions(-) (limited to 'src/components') diff --git a/src/components/footer.rs b/src/components/footer.rs index 2576163..1c6581d 100644 --- a/src/components/footer.rs +++ b/src/components/footer.rs @@ -1,14 +1,12 @@ use gtk::prelude::*; -use relm4::prelude::*; use relm4::actions::ActionablePlus; +use relm4::prelude::*; -use crate::tr; use crate::constants; +use crate::tr; -use crate::{ - ZoomInAction, ZoomOutAction, actions::Action -}; -use crate::icon_names::shipped::{ ZOOM_IN_REGULAR, ZOOM_OUT_REGULAR }; +use crate::icon_names::shipped::{ZOOM_IN_REGULAR, ZOOM_OUT_REGULAR}; +use crate::{ZoomInAction, ZoomOutAction, actions::Action}; // Model and Input Messages @@ -22,7 +20,7 @@ pub struct FooterInit { #[derive(Debug, Clone)] pub enum FooterAction { - SetZoom(f64) + SetZoom(f64), } #[relm4::component(pub)] @@ -81,9 +79,7 @@ impl SimpleComponent for Footer { root: Self::Root, sender: ComponentSender, ) -> ComponentParts { - let model = Footer { - zoom: init.zoom - }; + let model = Footer { zoom: init.zoom }; let widgets = view_output!(); ComponentParts { model, widgets } @@ -91,7 +87,7 @@ impl SimpleComponent for Footer { fn update(&mut self, message: Self::Input, _sender: ComponentSender) { match message { - FooterAction::SetZoom(zoom) => self.zoom = zoom + FooterAction::SetZoom(zoom) => self.zoom = zoom, } } } diff --git a/src/components/header.rs b/src/components/header.rs index 7a39490..6c1055b 100644 --- a/src/components/header.rs +++ b/src/components/header.rs @@ -1,19 +1,17 @@ use gtk::{gio, prelude::*}; -use relm4::prelude::*; use relm4::actions::{ActionablePlus, RelmAction}; +use relm4::prelude::*; use wmap_renderer::StageType; -use crate::tr; use crate::preferences::models::{CustomStage, Template}; use crate::stages::{ALL_STAGE_TYPES, LocalizedStageType}; +use crate::tr; -use crate::{ - ChangeOrientationAction, ExportImageAction, actions::Action -}; use crate::icon_names::shipped::{ - IMAGE_REGULAR, MENU_LARGE, SPLIT_HORIZONTAL_REGULAR, SPLIT_VERTICAL_REGULAR + IMAGE_REGULAR, MENU_LARGE, SPLIT_HORIZONTAL_REGULAR, SPLIT_VERTICAL_REGULAR, }; +use crate::{ChangeOrientationAction, ExportImageAction, actions::Action}; // Model and Input Messages @@ -24,7 +22,7 @@ pub struct Header { horizontal_layout_enabled: bool, templates_menu: gio::Menu, main_menu: gio::Menu, - layout_action: RelmAction + layout_action: RelmAction, } pub struct HeaderInit { @@ -43,7 +41,7 @@ pub enum HeaderAction { SetCustomStages(Vec), // Internal - StageTypeSelected(usize) + StageTypeSelected(usize), } #[relm4::component(pub)] @@ -110,7 +108,7 @@ impl SimpleComponent for Header { horizontal_layout_enabled: init.horizontal_layout_enabled, layout_action: init.layout_action, templates_menu, - main_menu + main_menu, }; let widgets = view_output!(); @@ -124,7 +122,7 @@ impl SimpleComponent for Header { HeaderAction::SetHorizontalLayoutEnabled(is_enabled) => { self.horizontal_layout_enabled = is_enabled; self.layout_action.set_enabled(is_enabled); - }, + } HeaderAction::SetLayoutOrientation(orientation) => self.orientation = orientation, HeaderAction::SetTemplates(templates) => { self.templates_menu.remove_all(); @@ -134,17 +132,17 @@ impl SimpleComponent for Header { Some(&format!("window.new-from-template::{}", template.id)), ); } - }, + } HeaderAction::SetCustomStages(stages) => { self.rebuild_custom_stages(&stages); - }, + } HeaderAction::StageTypeSelected(index) => { if index < self.available_stage_types.len() && let Some(stage_type) = self.available_stage_types.get(index) { let _ = sender.output(Action::StageTypeSelected(stage_type.clone())); } - }, + } } } } -- cgit