From 09427ccc9acb2a7f1c50fe7b114016676942e337 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 16 May 2025 01:05:37 +0300 Subject: [PATCH] config: better serialization in config structs --- src/config/types.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/types.rs b/src/config/types.rs index 1c606eb..7de13b7 100644 --- a/src/config/types.rs +++ b/src/config/types.rs @@ -119,7 +119,7 @@ impl std::fmt::Display for ConfigError { impl std::error::Error for ConfigError {} // Intermediate structs for TOML parsing -#[derive(Deserialize, Debug, Clone)] +#[derive(Deserialize, Serialize, Debug, Clone)] pub struct ProfileConfigToml { pub governor: Option, pub turbo: Option, // "always", "auto", "never" @@ -132,7 +132,7 @@ pub struct ProfileConfigToml { pub battery_charge_thresholds: Option, } -#[derive(Deserialize, Debug, Clone, Default)] +#[derive(Deserialize, Serialize, Debug, Clone, Default)] pub struct AppConfigToml { #[serde(default)] pub charger: ProfileConfigToml, @@ -286,7 +286,7 @@ const fn default_stats_file_path() -> Option { None } -#[derive(Deserialize, Debug, Clone)] +#[derive(Deserialize, Serialize, Debug, Clone)] pub struct DaemonConfigToml { #[serde(default = "default_poll_interval_sec")] pub poll_interval_sec: u64,