cargo clippy + fmt

This commit is contained in:
CreepySkeleton 2020-06-27 04:20:33 +03:00
parent f904bebd9a
commit a3206197ff
3 changed files with 4 additions and 12 deletions

View file

@ -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

View file

@ -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))

View file

@ -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 {