mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
refactor(app::Help): Use map.values() and don't do if !foo
when there is an else
This commit is contained in:
parent
7455d73404
commit
9679713a30
1 changed files with 12 additions and 12 deletions
|
@ -183,11 +183,11 @@ impl<'a> Help<'a> {
|
|||
}
|
||||
let mut first = true;
|
||||
for arg in arg_v {
|
||||
if !first {
|
||||
try!(self.writer.write(b"\n"));
|
||||
} else {
|
||||
if first {
|
||||
first = false;
|
||||
};
|
||||
} else {
|
||||
try!(self.writer.write(b"\n"));
|
||||
}
|
||||
try!(self.write_arg(arg.as_base(), longest));
|
||||
}
|
||||
Ok(())
|
||||
|
@ -212,12 +212,12 @@ impl<'a> Help<'a> {
|
|||
}
|
||||
}
|
||||
let mut first = true;
|
||||
for (_, btm) in ord_m {
|
||||
for btm in ord_m.values() {
|
||||
for arg in btm.values() {
|
||||
if !first {
|
||||
try!(self.writer.write(b"\n"));
|
||||
} else {
|
||||
if first {
|
||||
first = false;
|
||||
} else {
|
||||
try!(self.writer.write(b"\n"));
|
||||
}
|
||||
try!(self.write_arg(arg.as_base(), longest));
|
||||
}
|
||||
|
@ -616,12 +616,12 @@ impl<'a> Help<'a> {
|
|||
}
|
||||
|
||||
let mut first = true;
|
||||
for (_, btm) in ord_m {
|
||||
for btm in ord_m.values() {
|
||||
for sc in btm.values() {
|
||||
if !first {
|
||||
try!(self.writer.write(b"\n"));
|
||||
} else {
|
||||
if first {
|
||||
first = false;
|
||||
} else {
|
||||
try!(self.writer.write(b"\n"));
|
||||
}
|
||||
try!(self.write_arg(sc, longest));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue