Skip to content

Commit

Permalink
Fix literal flag not being recognized from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Akmadan23 committed Oct 16, 2023
1 parent 4bdf044 commit daaaac1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/flags/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl Configurable<Self> for Literal {
if cli.literal {
Some(Self(true))
} else {
Some(Self(false))
None
}
}

Expand All @@ -32,7 +32,7 @@ impl Configurable<Self> for Literal {
if let Some(value) = config.literal {
Some(Self(value))
} else {
Some(Self(false))
None
}
}
}
Expand All @@ -51,7 +51,7 @@ mod test {
fn test_from_cli_none() {
let argv = ["lsd"];
let cli = Cli::try_parse_from(argv).unwrap();
assert_eq!(Some(Literal(false)), Literal::from_cli(&cli));
assert_eq!(None, Literal::from_cli(&cli));
}

#[test]
Expand All @@ -63,10 +63,7 @@ mod test {

#[test]
fn test_from_config_none() {
assert_eq!(
Some(Literal(false)),
Literal::from_config(&Config::with_none())
);
assert_eq!(None, Literal::from_config(&Config::with_none()));
}

#[test]
Expand Down

0 comments on commit daaaac1

Please sign in to comment.