Просмотр исходного кода

fix(config): add serde(default) to StyleOverride.foreground/background fields

This is necessary with `deserialize_with`, otherwise serde expects this
field to be there and fails otherwise.

Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
Sandro-Alessio Gierens 1 год назад
Родитель
Сommit
0acb5f903c
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/options/config.rs

+ 2 - 2
src/options/config.rs

@@ -108,11 +108,11 @@ where D: Deserializer<'de> {
 #[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize, Deserialize, Default)]
 pub struct StyleOverride {
     /// The style's foreground color, if it has one.
-    #[serde(alias = "fg", deserialize_with = "deserialize_color")]
+    #[serde(alias = "fg", deserialize_with = "deserialize_color", default)]
     pub foreground: Option<Color>,
 
     /// The style's background color, if it has one.
-    #[serde(alias = "bg", deserialize_with = "deserialize_color")]
+    #[serde(alias = "bg", deserialize_with = "deserialize_color", default)]
     pub background: Option<Color>,
 
     /// Whether this style is bold.