Skip to content

Commit

Permalink
chore: skip serializing empty values in the config
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-zlobintsev committed Sep 22, 2024
1 parent 4a092b7 commit fa0eb30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lact-daemon/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Config {
pub daemon: Daemon,
#[serde(default = "default_apply_settings_timer")]
pub apply_settings_timer: u64,
#[serde(default, skip_serializing_if = "HashMap::is_empty")]
pub gpus: HashMap<String, Gpu>,
}

Expand All @@ -39,6 +40,7 @@ impl Default for Config {
}
}

#[skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Daemon {
pub log_level: String,
Expand Down Expand Up @@ -113,6 +115,7 @@ impl Gpu {
}
}

#[skip_serializing_none]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct FanControlSettings {
#[serde(default)]
Expand Down

0 comments on commit fa0eb30

Please sign in to comment.