From 71d91a74918e1f848911a8e095c94cfd41bf77b1 Mon Sep 17 00:00:00 2001 From: pml68 Date: Fri, 27 Jun 2025 03:32:19 +0200 Subject: feat: add rustfmt configuration --- src/lib.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index db4b4b5..a1c582d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use std::sync::LazyLock; use iced_widget::core::theme::{Base, Style}; -use iced_widget::core::{color, Color}; +use iced_widget::core::{Color, color}; use utils::{lightness, mix}; pub mod button; @@ -46,8 +46,9 @@ macro_rules! from_argb { } #[cfg(feature = "system-theme")] -pub static SYSTEM_IS_DARK: LazyLock = - LazyLock::new(|| dark_light::detect().is_ok_and(|mode| mode == dark_light::Mode::Dark)); +pub static SYSTEM_IS_DARK: LazyLock = LazyLock::new(|| { + dark_light::detect().is_ok_and(|mode| mode == dark_light::Mode::Dark) +}); #[allow(clippy::large_enum_variant)] #[derive(Debug, Clone, PartialEq)] @@ -69,7 +70,10 @@ impl Theme { Self::System, ]; - pub fn new(name: impl Into>, colorscheme: ColorScheme) -> Self { + pub fn new( + name: impl Into>, + colorscheme: ColorScheme, + ) -> Self { Self::Custom(Custom { name: name.into(), is_dark: lightness(colorscheme.surface.color) <= 0.5, @@ -77,7 +81,10 @@ impl Theme { }) } - pub const fn new_const(name: &'static str, colorscheme: ColorScheme) -> Self { + pub const fn new_const( + name: &'static str, + colorscheme: ColorScheme, + ) -> Self { Self::Custom(Custom { name: Cow::Borrowed(name), is_dark: lightness(colorscheme.surface.color) <= 0.5, -- cgit v1.2.3