mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
chore: clippy run
This commit is contained in:
parent
b94f897daf
commit
e9efa8ed6f
3 changed files with 5 additions and 5 deletions
|
@ -1989,6 +1989,7 @@ impl<'a, 'b> Parser<'a, 'b>
|
|||
None
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "lints", allow(explicit_iter_loop))]
|
||||
pub fn find_subcommand(&'b self, sc: &str) -> Option<&'b App<'a, 'b>> {
|
||||
debugln!("fn=find_subcommand;");
|
||||
debugln!("Looking for sc...{}", sc);
|
||||
|
|
|
@ -83,7 +83,7 @@ pub fn subcommands_of(p: &Parser) -> Vec<(String, String)> {
|
|||
if let Some(ref aliases) = p.meta.aliases {
|
||||
for &(n, _) in aliases {
|
||||
debugln!("Found alias...{}", n);
|
||||
let mut als_bin_name: Vec<_> = p.meta.bin_name.as_ref().unwrap().split(" ").collect();
|
||||
let mut als_bin_name: Vec<_> = p.meta.bin_name.as_ref().unwrap().split(' ').collect();
|
||||
als_bin_name.push(n);
|
||||
let old = als_bin_name.len() - 2;
|
||||
als_bin_name.swap_remove(old);
|
||||
|
@ -100,7 +100,7 @@ pub fn subcommands_of(p: &Parser) -> Vec<(String, String)> {
|
|||
if let Some(ref aliases) = sc.p.meta.aliases {
|
||||
for &(n, _) in aliases {
|
||||
debugln!("Found alias...{}", n);
|
||||
let mut als_bin_name: Vec<_> = p.meta.bin_name.as_ref().unwrap().split(" ").collect();
|
||||
let mut als_bin_name: Vec<_> = p.meta.bin_name.as_ref().unwrap().split(' ').collect();
|
||||
als_bin_name.push(n);
|
||||
let old = als_bin_name.len() - 2;
|
||||
als_bin_name.swap_remove(old);
|
||||
|
|
|
@ -294,12 +294,11 @@ fn write_opts_of(p: &Parser) -> String {
|
|||
conflicts = if conflicts.is_empty() { String::new() } else { format!("({})", conflicts) };
|
||||
|
||||
let multiple = if o.is_set(ArgSettings::Multiple) { "*" } else { "" };
|
||||
let pv = format!("{}",
|
||||
if let Some(pv_vec) = o.possible_vals() {
|
||||
let pv = if let Some(pv_vec) = o.possible_vals() {
|
||||
format!(": :({})", pv_vec.join(" "))
|
||||
} else {
|
||||
String::new()
|
||||
});
|
||||
};
|
||||
if let Some(short) = o.short() {
|
||||
let s = format!("\"{conflicts}{multiple}-{arg}+[{help}]{possible_values}\" \\",
|
||||
conflicts = conflicts,
|
||||
|
|
Loading…
Reference in a new issue