mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
config: better serialization in config structs
This commit is contained in:
parent
8252f0d74e
commit
09427ccc9a
1 changed files with 3 additions and 3 deletions
|
@ -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<String>,
|
||||
pub turbo: Option<String>, // "always", "auto", "never"
|
||||
|
@ -132,7 +132,7 @@ pub struct ProfileConfigToml {
|
|||
pub battery_charge_thresholds: Option<BatteryChargeThresholds>,
|
||||
}
|
||||
|
||||
#[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<String> {
|
|||
None
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||
pub struct DaemonConfigToml {
|
||||
#[serde(default = "default_poll_interval_sec")]
|
||||
pub poll_interval_sec: u64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue