diff --git a/src/app/parser.rs b/src/app/parser.rs index aa3d7404..c80d4bf2 100644 --- a/src/app/parser.rs +++ b/src/app/parser.rs @@ -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()); } } } diff --git a/src/args/arg.rs b/src/args/arg.rs index 6799cccf..b30c146a 100644 --- a/src/args/arg.rs +++ b/src/args/arg.rs @@ -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, } diff --git a/src/args/arg_builder/flag.rs b/src/args/arg_builder/flag.rs index e22d34b1..faef9780 100644 --- a/src/args/arg_builder/flag.rs +++ b/src/args/arg_builder/flag.rs @@ -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, } } } diff --git a/src/args/arg_builder/option.rs b/src/args/arg_builder/option.rs index a2bf0c75..58ca132e 100644 --- a/src/args/arg_builder/option.rs +++ b/src/args/arg_builder/option.rs @@ -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() }; diff --git a/src/args/arg_builder/positional.rs b/src/args/arg_builder/positional.rs index b3ff352b..893dd125 100644 --- a/src/args/arg_builder/positional.rs +++ b/src/args/arg_builder/positional.rs @@ -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() }; diff --git a/src/suggestions.rs b/src/suggestions.rs index 7ae99668..81ea7f43 100644 --- a/src/suggestions.rs +++ b/src/suggestions.rs @@ -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()[..]);