diff --git a/src/app/core.rs b/src/app/core.rs index c58763f8..0a4a97b8 100644 --- a/src/app/core.rs +++ b/src/app/core.rs @@ -4,10 +4,10 @@ use std::collections::HashMap; use crate::widget::{ - button, icon, - menu::{self}, - nav_bar, responsive_container, - }; + button, icon, + menu::{self}, + nav_bar, responsive_container, +}; use cosmic_config::CosmicConfigEntry; use cosmic_theme::ThemeMode; use iced::{window, Limits, Size}; @@ -17,7 +17,6 @@ use slotmap::Key; use crate::Theme; - /// Status of the nav bar and its panels. #[derive(Clone)] pub struct NavBar { @@ -403,10 +402,6 @@ impl Core { Vec>>, )>, ) -> crate::Element<'a, Message> { - - - - use crate::widget::id_container; let menu_bar_size = self.menu_bars.get(&id); diff --git a/src/app/mod.rs b/src/app/mod.rs index dcaabf31..293e300c 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -6,7 +6,6 @@ //! Check out our [application](https://github.com/pop-os/libcosmic/tree/master/examples/application) //! example in our repository. - pub mod command; pub mod context_drawer; mod core; @@ -18,8 +17,6 @@ pub mod settings; pub mod message { use crate::surface_message::SurfaceMessage; - - #[derive(Clone, Debug)] #[must_use] pub enum Message { @@ -549,7 +546,8 @@ where } else { p.activate(platform_data) } - }; match res { + }; + match res { Ok(()) => { tracing::info!("Successfully activated another instance"); true diff --git a/src/applet/mod.rs b/src/applet/mod.rs index cbf9ae9a..9da2391b 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -25,12 +25,7 @@ use cosmic_panel_config::{CosmicPanelBackground, PanelAnchor, PanelSize}; use iced_core::{Layout, Padding, Shadow}; use iced_widget::runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner}; use sctk::reexports::protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity}; -use std::{ - borrow::Cow, - num::NonZeroU32, - rc::Rc, - sync::LazyLock, -}; +use std::{borrow::Cow, num::NonZeroU32, rc::Rc, sync::LazyLock}; use tracing::info; use crate::app::cosmic; @@ -166,11 +161,7 @@ impl Context { let height = f32::from(height) + applet_padding as f32 * 2.; let mut settings = crate::app::Settings::default() .size(iced_core::Size::new(width, height)) - .size_limits( - Limits::NONE - .min_height(height) - .min_width(width), - ) + .size_limits(Limits::NONE.min_height(height).min_width(width)) .resizable(None) .default_text_size(14.0) .default_font(crate::font::default()) diff --git a/src/config/mod.rs b/src/config/mod.rs index a2cb66c4..1e82becd 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -152,7 +152,8 @@ impl From for iced::Font { let mut family_map = FAMILY_MAP.lock().unwrap(); let name: &'static str = family_map - .get(font.family.as_str()).copied() + .get(font.family.as_str()) + .copied() .unwrap_or_else(|| { let value = font.family.clone().leak(); family_map.insert(value); diff --git a/src/theme/style/iced.rs b/src/theme/style/iced.rs index 60a8b1db..718ce3ad 100644 --- a/src/theme/style/iced.rs +++ b/src/theme/style/iced.rs @@ -725,9 +725,7 @@ impl slider::Catalog for Theme { impl menu::Catalog for Theme { type Class<'a> = (); - fn default<'a>() -> ::Class<'a> { - - } + fn default<'a>() -> ::Class<'a> {} fn style(&self, class: &::Class<'_>) -> menu::Style { let cosmic = self.cosmic(); @@ -751,9 +749,7 @@ impl menu::Catalog for Theme { impl pick_list::Catalog for Theme { type Class<'a> = (); - fn default<'a>() -> ::Class<'a> { - - } + fn default<'a>() -> ::Class<'a> {} fn style( &self, @@ -790,9 +786,7 @@ impl pick_list::Catalog for Theme { impl radio::Catalog for Theme { type Class<'a> = (); - fn default<'a>() -> Self::Class<'a> { - - } + fn default<'a>() -> Self::Class<'a> {} fn style(&self, class: &Self::Class<'_>, status: radio::Status) -> radio::Style { let theme = self.cosmic(); @@ -844,9 +838,7 @@ impl radio::Catalog for Theme { impl toggler::Catalog for Theme { type Class<'a> = (); - fn default<'a>() -> Self::Class<'a> { - - } + fn default<'a>() -> Self::Class<'a> {} fn style(&self, class: &Self::Class<'_>, status: toggler::Status) -> toggler::Style { let cosmic = self.cosmic(); @@ -901,9 +893,7 @@ impl toggler::Catalog for Theme { impl pane_grid::Catalog for Theme { type Class<'a> = (); - fn default<'a>() -> ::Class<'a> { - - } + fn default<'a>() -> ::Class<'a> {} fn style(&self, class: &::Class<'_>) -> pane_grid::Style { let theme = self.cosmic(); diff --git a/src/widget/button/widget.rs b/src/widget/button/widget.rs index 755c66df..c3e51495 100644 --- a/src/widget/button/widget.rs +++ b/src/widget/button/widget.rs @@ -593,12 +593,7 @@ impl<'a, Message: 'a + Clone> Widget } match self.description.as_ref() { Some(iced_accessibility::Description::Id(id)) => { - node.set_described_by( - id.iter() - .cloned() - .map(NodeId::from) - .collect::>(), - ); + node.set_described_by(id.iter().cloned().map(NodeId::from).collect::>()); } Some(iced_accessibility::Description::Text(text)) => { node.set_description(text.clone()); diff --git a/src/widget/context_drawer/overlay.rs b/src/widget/context_drawer/overlay.rs index 0bb44929..c4b779ac 100644 --- a/src/widget/context_drawer/overlay.rs +++ b/src/widget/context_drawer/overlay.rs @@ -17,8 +17,7 @@ pub(super) struct Overlay<'a, 'b, Message> { pub(super) width: f32, } -impl overlay::Overlay - for Overlay<'_, '_, Message> +impl overlay::Overlay for Overlay<'_, '_, Message> where Message: Clone, { diff --git a/src/widget/context_menu.rs b/src/widget/context_menu.rs index f7d50434..10f3ef3e 100644 --- a/src/widget/context_menu.rs +++ b/src/widget/context_menu.rs @@ -46,9 +46,7 @@ pub struct ContextMenu<'a, Message> { context_menu: Option>>, } -impl Widget - for ContextMenu<'_, Message> -{ +impl Widget for ContextMenu<'_, Message> { fn tag(&self) -> tree::Tag { tree::Tag::of::() } diff --git a/src/widget/dropdown/menu/mod.rs b/src/widget/dropdown/menu/mod.rs index f10be142..3d4a8c41 100644 --- a/src/widget/dropdown/menu/mod.rs +++ b/src/widget/dropdown/menu/mod.rs @@ -417,8 +417,7 @@ where text_line_height: text::LineHeight, } -impl, Message> Widget - for List<'_, S, Message> +impl, Message> Widget for List<'_, S, Message> where [S]: std::borrow::ToOwned, { diff --git a/src/widget/dropdown/multi/menu.rs b/src/widget/dropdown/multi/menu.rs index 4587b220..3d37d928 100644 --- a/src/widget/dropdown/multi/menu.rs +++ b/src/widget/dropdown/multi/menu.rs @@ -180,9 +180,7 @@ impl<'a, Message: 'a> Overlay<'a, Message> { } } -impl iced_core::Overlay - for Overlay<'_, Message> -{ +impl iced_core::Overlay for Overlay<'_, Message> { fn layout(&mut self, renderer: &crate::Renderer, bounds: Size) -> layout::Node { let position = self.position; let space_below = bounds.height - (position.y + self.target_height); diff --git a/src/widget/flex_row/widget.rs b/src/widget/flex_row/widget.rs index 1b6aeb00..852c18cc 100644 --- a/src/widget/flex_row/widget.rs +++ b/src/widget/flex_row/widget.rs @@ -85,9 +85,7 @@ impl<'a, Message> FlexRow<'a, Message> { } } -impl Widget - for FlexRow<'_, Message> -{ +impl Widget for FlexRow<'_, Message> { fn children(&self) -> Vec { self.children.iter().map(Tree::new).collect() } diff --git a/src/widget/layer_container.rs b/src/widget/layer_container.rs index c482da4a..f442bc51 100644 --- a/src/widget/layer_container.rs +++ b/src/widget/layer_container.rs @@ -138,8 +138,7 @@ where } } -impl Widget - for LayerContainer<'_, Message, Renderer> +impl Widget for LayerContainer<'_, Message, Renderer> where Renderer: iced_core::Renderer, { diff --git a/src/widget/menu/menu_bar.rs b/src/widget/menu/menu_bar.rs index b02e0ad2..283e5922 100644 --- a/src/widget/menu/menu_bar.rs +++ b/src/widget/menu/menu_bar.rs @@ -280,8 +280,7 @@ where self } } -impl Widget - for MenuBar<'_, Message, Renderer> +impl Widget for MenuBar<'_, Message, Renderer> where Renderer: renderer::Renderer, { diff --git a/src/widget/mod.rs b/src/widget/mod.rs index 52978f46..46264a0e 100644 --- a/src/widget/mod.rs +++ b/src/widget/mod.rs @@ -344,7 +344,6 @@ pub mod wayland; pub mod tooltip { use crate::Element; - pub use iced::widget::tooltip::Position; diff --git a/src/widget/settings/section.rs b/src/widget/settings/section.rs index 01937671..71b9a92e 100644 --- a/src/widget/settings/section.rs +++ b/src/widget/settings/section.rs @@ -20,9 +20,7 @@ pub fn section<'a, Message: 'static>() -> Section<'a, Message> { } /// A section with a pre-defined list column. -pub fn with_column( - children: ListColumn<'_, Message>, -) -> Section<'_, Message> { +pub fn with_column(children: ListColumn<'_, Message>) -> Section<'_, Message> { Section { title: Cow::Borrowed(""), children, diff --git a/src/widget/spin_button.rs b/src/widget/spin_button.rs index 1a0511b6..8a5b36e4 100644 --- a/src/widget/spin_button.rs +++ b/src/widget/spin_button.rs @@ -9,10 +9,10 @@ use crate::{ Element, }; use apply::Apply; -use iced::{Border, Shadow}; use iced::{Alignment, Length}; -use std::ops::{Add, Sub}; +use iced::{Border, Shadow}; use std::borrow::Cow; +use std::ops::{Add, Sub}; /// Horizontal spin button widget. pub fn spin_button<'a, T, M>( @@ -151,9 +151,7 @@ where } } -fn horizontal_variant( - spin_button: SpinButton<'_, T, Message>, -) -> Element<'_, Message> +fn horizontal_variant(spin_button: SpinButton<'_, T, Message>) -> Element<'_, Message> where Message: Clone + 'static, T: Copy + Sub + Add + PartialOrd, diff --git a/src/widget/wayland/tooltip/widget.rs b/src/widget/wayland/tooltip/widget.rs index 0eb3352c..a6eae43a 100644 --- a/src/widget/wayland/tooltip/widget.rs +++ b/src/widget/wayland/tooltip/widget.rs @@ -20,7 +20,6 @@ use iced_core::{ Background, Clipboard, Color, Layout, Length, Padding, Point, Rectangle, Shell, Vector, Widget, }; - pub use super::{Catalog, Style}; /// Internally defines different button widget variants.