From 410e96ef7f517440a31a3795d5889de7fb17751f Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 11 Mar 2019 10:53:12 +0100 Subject: [PATCH] Ensure that all config keys are optional Without this change, a config without a [display] section would fail to parse. --- src/config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index d73250b..cad267c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -116,7 +116,9 @@ struct RawDisplayConfig { #[derive(Debug, Default, Serialize, Deserialize, PartialEq, Eq)] struct RawConfig { + #[serde(default)] style: RawStyleConfig, + #[serde(default)] display: RawDisplayConfig, } @@ -134,7 +136,7 @@ impl RawConfig { raw_config } -} // impl RawConfig +} #[derive(Copy, Clone, Debug, PartialEq)] pub struct StyleConfig {