Add a comment to parse_bool.
It's behaviour can be surprising.
This commit is contained in:
parent
c55c682e9b
commit
8818eace09
1 changed files with 3 additions and 0 deletions
|
|
@ -299,6 +299,9 @@ macro_rules! options {
|
|||
}
|
||||
)*
|
||||
|
||||
/// Set a flag to true. Note that it cannot set the flag to false, so
|
||||
/// using this parser in combination with a flag that defaults to true
|
||||
/// is useless; the flag will always be true.
|
||||
fn parse_bool(slot: &mut bool, v: Option<&str>) -> bool {
|
||||
match v {
|
||||
Some(..) => false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue