mirror of
https://github.com/clap-rs/clap
synced 2024-11-12 23:57:10 +00:00
cargo clippy + fmt
This commit is contained in:
parent
f904bebd9a
commit
a3206197ff
3 changed files with 4 additions and 12 deletions
|
@ -162,7 +162,7 @@ impl<'b> App<'b> {
|
|||
self.get_arguments()
|
||||
.iter()
|
||||
.filter(|a| !a.is_set(ArgSettings::TakesValue) && a.get_index().is_none())
|
||||
.filter(|a| !a.get_help_heading().is_some())
|
||||
.filter(|a| a.get_help_heading().is_none())
|
||||
}
|
||||
|
||||
/// Iterate through the *options* that don't have custom heading.
|
||||
|
@ -170,7 +170,7 @@ impl<'b> App<'b> {
|
|||
self.get_arguments()
|
||||
.iter()
|
||||
.filter(|a| a.is_set(ArgSettings::TakesValue) && a.get_index().is_none())
|
||||
.filter(|a| !a.get_help_heading().is_some())
|
||||
.filter(|a| a.get_help_heading().is_none())
|
||||
}
|
||||
|
||||
/// Get the list of arguments the given argument conflicts with
|
||||
|
|
|
@ -291,13 +291,7 @@ impl<'b, 'c, 'z> Usage<'b, 'c, 'z> {
|
|||
self.p
|
||||
.app
|
||||
.get_positionals()
|
||||
.filter_map(|pos| {
|
||||
if pos.index <= highest_req_pos {
|
||||
Some(pos)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.filter(|pos| pos.index <= highest_req_pos)
|
||||
.filter(|pos| !pos.is_set(ArgSettings::Required))
|
||||
.filter(|pos| !pos.is_set(ArgSettings::Hidden))
|
||||
.filter(|pos| !pos.is_set(ArgSettings::Last))
|
||||
|
|
|
@ -45,9 +45,7 @@ where
|
|||
use crate::mkeymap::KeyType;
|
||||
|
||||
match did_you_mean(arg, longs).pop() {
|
||||
Some(candidate) => {
|
||||
return Some((candidate, None));
|
||||
}
|
||||
Some(candidate) => Some((candidate, None)),
|
||||
|
||||
None => {
|
||||
for subcommand in subcommands {
|
||||
|
|
Loading…
Reference in a new issue