fix clippy warnings

This commit is contained in:
Jorge Aparicio 2016-02-22 18:36:57 -05:00
parent 6c851f4314
commit 56d14cbbb6
6 changed files with 10 additions and 12 deletions

View file

@ -296,7 +296,7 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b {
continue;
}
if let Some(p) = self.positionals.values().filter(|x| &x.name == &p).next() {
pmap.insert(p.index, format!("{}", p));
pmap.insert(p.index, p.to_string());
}
}
for (_, s) in pmap {
@ -308,9 +308,7 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b {
if $m.is_some() && $m.as_ref().unwrap().contains(f) {
continue;
}
$r.push_back(format!("{}", $i.filter(|flg| &flg.name == &f)
.next()
.unwrap()));
$r.push_back($i.filter(|flg| &flg.name == &f).next().unwrap().to_string());
}
}
}
@ -629,21 +627,21 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b {
if let Some(f) = self.flags.iter().filter(|f| &f.name == &k).next() {
if let Some(ref bl) = f.blacklist {
if bl.contains(&name) {
return Some(format!("{}", f));
return Some(f.to_string());
}
}
}
if let Some(o) = self.opts.iter().filter(|o| &o.name == &k).next() {
if let Some(ref bl) = o.blacklist {
if bl.contains(&name) {
return Some(format!("{}", o));
return Some(o.to_string());
}
}
}
if let Some(pos) = self.positionals.values().filter(|p| &p.name == &k).next() {
if let Some(ref bl) = pos.blacklist {
if bl.contains(&name) {
return Some(format!("{}", pos));
return Some(pos.to_string());
}
}
}

View file

@ -1842,7 +1842,7 @@ impl<'a, 'b, 'z> From<&'z Arg<'a, 'b>>
group: a.group,
validator: a.validator.clone(),
overrides: a.overrides.clone(),
settings: a.settings.clone(),
settings: a.settings,
val_delim: a.val_delim,
default_val: a.default_val,
}

View file

@ -73,7 +73,7 @@ impl<'a, 'b, 'z> From<&'z Arg<'a, 'b>> for FlagBuilder<'a, 'b> {
blacklist: a.blacklist.clone(),
overrides: a.overrides.clone(),
requires: a.requires.clone(),
settings: a.settings.clone(),
settings: a.settings,
}
}
}

View file

@ -80,7 +80,7 @@ impl<'n, 'e> OptBuilder<'n, 'e> {
overrides: a.overrides.clone(),
requires: a.requires.clone(),
possible_vals: a.possible_vals.clone(),
settings: a.settings.clone(),
settings: a.settings,
default_val: a.default_val,
..Default::default()
};

View file

@ -81,7 +81,7 @@ impl<'n, 'e> PosBuilder<'n, 'e> {
possible_vals: a.possible_vals.clone(),
help: a.help,
val_delim: a.val_delim,
settings: a.settings.clone(),
settings: a.settings,
default_val: a.default_val,
..Default::default()
};

View file

@ -50,7 +50,7 @@ pub fn did_you_mean_suffix<'z, T, I>(arg: &str,
let mut suffix = "\n\tDid you mean ".to_owned();
match style {
DidYouMeanMessageStyle::LongFlag =>
suffix.push_str(&*format!("{}", Format::Good("--"))),
suffix.push_str(&Format::Good("--").to_string()),
DidYouMeanMessageStyle::EnumValue => suffix.push('\''),
}
suffix.push_str(&Format::Good(candidate).to_string()[..]);