chore: clippy run

This commit is contained in:
Kevin K 2016-10-24 05:56:32 -04:00
parent b94f897daf
commit e9efa8ed6f
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A
3 changed files with 5 additions and 5 deletions

View file

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

View file

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

View file

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