diff --git a/src/app/parser.rs b/src/app/parser.rs index f7913bc9..6c327e24 100644 --- a/src/app/parser.rs +++ b/src/app/parser.rs @@ -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); diff --git a/src/completions/mod.rs b/src/completions/mod.rs index 9ca11641..f7ba2a7e 100644 --- a/src/completions/mod.rs +++ b/src/completions/mod.rs @@ -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); diff --git a/src/completions/zsh.rs b/src/completions/zsh.rs index 679d9af7..f9dbfe1d 100644 --- a/src/completions/zsh.rs +++ b/src/completions/zsh.rs @@ -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,