From 070e477fd4872c5c600b9ae63505e017ba0167bd Mon Sep 17 00:00:00 2001 From: futile Date: Sat, 10 May 2025 06:57:26 +0100 Subject: [PATCH] derive default on some shit instead of manually --- src/gui/settings.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/gui/settings.rs b/src/gui/settings.rs index 2123f30..8eb8e47 100644 --- a/src/gui/settings.rs +++ b/src/gui/settings.rs @@ -2,8 +2,9 @@ use crate::util::win; use serde::{Deserialize, Serialize}; use strum::{Display, EnumIter}; -#[derive(Clone, Copy, Debug, Display, PartialEq, Eq, Serialize, Deserialize, EnumIter)] +#[derive(Clone, Copy, Debug, Default, Display, PartialEq, Eq, Serialize, Deserialize, EnumIter)] pub enum Theme { + #[default] #[strum(to_string = "Auto")] Auto, #[strum(to_string = "Catppuccin Latte")] @@ -34,17 +35,8 @@ impl From for catppuccin_egui::Theme { } } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct Settings { pub theme: Theme, pub start_elevated: bool, } - -impl Default for Settings { - fn default() -> Self { - Self { - theme: Theme::Auto, - start_elevated: false, - } - } -}