mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
Fix clippy
This commit is contained in:
parent
ad3d3a13cd
commit
53fdc9d6b2
1 changed files with 7 additions and 9 deletions
|
@ -1593,15 +1593,13 @@ impl<'help, 'app> Parser<'help, 'app> {
|
|||
for a in self.app.args.args.iter() {
|
||||
// Use env only if the arg was not present among command line args
|
||||
if matcher.get(&a.id).map_or(true, |a| a.occurs == 0) {
|
||||
if let Some((_, ref val)) = a.env {
|
||||
if let Some(ref val) = val {
|
||||
let val = &ArgStr::new(val);
|
||||
if a.is_set(ArgSettings::TakesValue) {
|
||||
self.add_val_to_arg(a, val, matcher, ValueType::EnvVariable)?;
|
||||
} else {
|
||||
self.check_for_help_and_version_str(val)?;
|
||||
matcher.add_index_to(&a.id, self.cur_idx.get(), ValueType::EnvVariable);
|
||||
}
|
||||
if let Some((_, Some(ref val))) = a.env {
|
||||
let val = &ArgStr::new(val);
|
||||
if a.is_set(ArgSettings::TakesValue) {
|
||||
self.add_val_to_arg(a, val, matcher, ValueType::EnvVariable)?;
|
||||
} else {
|
||||
self.check_for_help_and_version_str(val)?;
|
||||
matcher.add_index_to(&a.id, self.cur_idx.get(), ValueType::EnvVariable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue