diff options
Diffstat (limited to 'alacritty_config/src/lib.rs')
-rw-r--r-- | alacritty_config/src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/alacritty_config/src/lib.rs b/alacritty_config/src/lib.rs index 81e43bb8..8da91e19 100644 --- a/alacritty_config/src/lib.rs +++ b/alacritty_config/src/lib.rs @@ -61,7 +61,15 @@ impl<'de, T: SerdeReplace + Deserialize<'de>> SerdeReplace for Option<T> { impl<'de, T: Deserialize<'de>> SerdeReplace for HashMap<String, T> { fn replace(&mut self, value: Value) -> Result<(), Box<dyn Error>> { - replace_simple(self, value) + // Deserialize replacement as HashMap. + let hashmap: HashMap<String, T> = Self::deserialize(value)?; + + // Merge the two HashMaps, replacing existing values. + for (key, value) in hashmap { + self.insert(key, value); + } + + Ok(()) } } |