diff options
| author | pml68 <contact@pml68.dev> | 2025-01-04 22:45:52 +0100 |
|---|---|---|
| committer | pml68 <contact@pml68.dev> | 2025-01-04 22:45:52 +0100 |
| commit | eaaaf2ac7182de1be043b223337e4d8a56e458e1 (patch) | |
| tree | f2ea1096499d31ead4f5d1f03087ade7bcebb9ed /iced_builder/src/theme.rs | |
| parent | feat: add custom theme codegen for `Project` (diff) | |
| download | iced-builder-eaaaf2ac7182de1be043b223337e4d8a56e458e1.tar.gz | |
refactor: apply clippy suggestions
Diffstat (limited to '')
| -rw-r--r-- | iced_builder/src/theme.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/iced_builder/src/theme.rs b/iced_builder/src/theme.rs index e128162..7d18aa9 100644 --- a/iced_builder/src/theme.rs +++ b/iced_builder/src/theme.rs @@ -8,7 +8,7 @@ use crate::config::Config; pub fn theme_index(theme_name: &str, slice: &[iced::Theme]) -> Option<usize> { slice .iter() - .position(|theme| &theme.to_string() == theme_name) + .position(|theme| theme.to_string() == theme_name) } pub fn theme_from_str( @@ -43,7 +43,7 @@ pub fn theme_from_str( if theme_name == config.theme.selected.to_string() { config.theme.selected.clone() } else if let Some(index) = - theme_index(theme_name.into(), &config.theme.all) + theme_index(theme_name, &config.theme.all) { config.theme.all[index].clone() } else { @@ -142,7 +142,7 @@ pub fn theme_to_string(theme: &iced::Theme) -> String { fn color_to_hex(color: Color) -> String { use std::fmt::Write; - let mut hex = String::with_capacity(16); + let mut hex = String::with_capacity(12); let [r, g, b, a] = color.into_rgba8(); |
