aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--mingling/src/parser/picker/bools.rs17
2 files changed, 7 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1bd92c..808b808 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
#### Fixes:
1. Fixed a build failure on **Windows** caused by `mingling_core/src/program.rs`
+2. **\[picker\]** Fixed an issue where the `Pickable` trait for `Yes` and `True` types could not correctly parse explicit boolean `--value true`
#### Features:
diff --git a/mingling/src/parser/picker/bools.rs b/mingling/src/parser/picker/bools.rs
index 4015cd9..80e6d5b 100644
--- a/mingling/src/parser/picker/bools.rs
+++ b/mingling/src/parser/picker/bools.rs
@@ -113,17 +113,12 @@ fn pick_bool(
flag: mingling_core::Flag,
positive: &[&str],
) -> bool {
- let has_flag = args.pick_flag(flag.clone());
- if !has_flag {
- let content = args.pick_argument(flag);
- match content {
- Some(content) => {
- let s = content.as_str();
- positive.contains(&s)
- }
- None => false,
+ let content = args.pick_argument(flag);
+ match content {
+ Some(content) => {
+ let s = content.as_str();
+ positive.contains(&s)
}
- } else {
- true
+ None => false,
}
}