1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

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

View file

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