Fix deserialization of untagged enums

Fixes #4634.
This commit is contained in:
Christian Duerr 2021-01-02 02:30:52 +00:00 committed by GitHub
parent 43ea180d8e
commit 56097de74e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -131,7 +131,12 @@ impl Cursor {
#[derive(Deserialize, Debug, Copy, Clone, PartialEq, Eq)]
pub enum ConfigCursorStyle {
Shape(CursorShape),
WithBlinking { shape: CursorShape, blinking: CursorBlinking },
WithBlinking {
#[serde(default)]
shape: CursorShape,
#[serde(default)]
blinking: CursorBlinking,
},
}
impl Default for ConfigCursorStyle {
@ -195,7 +200,11 @@ impl Into<bool> for CursorBlinking {
#[derive(Deserialize, Debug, Clone, PartialEq, Eq)]
pub enum Program {
Just(String),
WithArgs { program: String, args: Vec<String> },
WithArgs {
program: String,
#[serde(default)]
args: Vec<String>,
},
}
impl Program {