aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2023-06-17 22:41:28 +0200
committerGitHub <noreply@github.com>2023-06-17 20:41:28 +0000
commitcb48ac92071c43a9163329b66b5f74a7fb3dca69 (patch)
tree8f0a497b3588bbcc959d99a4178cb11266a9bfc3 /alacritty_terminal
parent474ee4bb75d06e9dfcf4a050fb738b45f8dd9135 (diff)
downloadalacritty-cb48ac92071c43a9163329b66b5f74a7fb3dca69.tar.gz
alacritty-cb48ac92071c43a9163329b66b5f74a7fb3dca69.zip
Add errors for deserializing with unknown fields
Currently there are still some places where `Deserialize` is used rather than `ConfigDeserialize`, which means that the built-in warning for unused fields is not emitted automatically. To ensure users don't have invalid configurations, the `#[serde(deny_unknown_fields)]` annotation has been added to these structs, making it a hard error when an unknown field is present.
Diffstat (limited to 'alacritty_terminal')
-rw-r--r--alacritty_terminal/src/config/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs
index 2d921b6e..80be4d16 100644
--- a/alacritty_terminal/src/config/mod.rs
+++ b/alacritty_terminal/src/config/mod.rs
@@ -127,7 +127,7 @@ impl Cursor {
}
#[derive(SerdeReplace, Deserialize, Debug, Copy, Clone, PartialEq, Eq)]
-#[serde(untagged)]
+#[serde(untagged, deny_unknown_fields)]
pub enum ConfigCursorStyle {
Shape(CursorShapeShim),
WithBlinking {
@@ -191,7 +191,7 @@ impl From<CursorBlinking> for bool {
}
#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
-#[serde(untagged)]
+#[serde(untagged, deny_unknown_fields)]
pub enum Program {
Just(String),
WithArgs {