mirror of
https://github.com/clap-rs/clap
synced 2024-09-20 22:41:52 +00:00
fix: fixes an intentional panic issue discovered via clippy
This commit is contained in:
parent
4e3bd16679
commit
ea83a3d421
2 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ vec_map = "0.4"
|
||||||
ansi_term = { version = "~0.7", optional = true }
|
ansi_term = { version = "~0.7", optional = true }
|
||||||
strsim = { version = "~0.4.0", optional = true }
|
strsim = { version = "~0.4.0", optional = true }
|
||||||
yaml-rust = { version = "~0.2.2", optional = true }
|
yaml-rust = { version = "~0.2.2", optional = true }
|
||||||
clippy = { version = "~0.0.29", optional = true }
|
clippy = { version = "~0.0.35", optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["suggestions", "color"]
|
default = ["suggestions", "color"]
|
||||||
|
|
|
@ -83,7 +83,7 @@ impl<'n, 'a> From<&'a Arg<'n, 'n, 'n, 'n, 'n, 'n>> for FlagBuilder<'n> {
|
||||||
fn from(a: &Arg<'n, 'n, 'n, 'n, 'n, 'n>) -> Self {
|
fn from(a: &Arg<'n, 'n, 'n, 'n, 'n, 'n>) -> Self {
|
||||||
if a.validator.is_some() {
|
if a.validator.is_some() {
|
||||||
panic!("The argument '{}' has a validator set, yet was parsed as a flag. Ensure \
|
panic!("The argument '{}' has a validator set, yet was parsed as a flag. Ensure \
|
||||||
.takes_value(true) or .index(u8) is set.")
|
.takes_value(true) or .index(u8) is set.", a.name)
|
||||||
}
|
}
|
||||||
if !a.empty_vals {
|
if !a.empty_vals {
|
||||||
// Empty vals defaults to true, so if it's false it was manually set
|
// Empty vals defaults to true, so if it's false it was manually set
|
||||||
|
|
Loading…
Reference in a new issue