Skip to content

Commit

Permalink
Auto merge of #457 - kbknapp:clippy-update, r=kbknapp
Browse files Browse the repository at this point in the history
Clippy update
  • Loading branch information
homu committed Mar 23, 2016
2 parents afa6b5d + 144e7e2 commit 96869df
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sudo: false
language: rust
rust:
- nightly
- nightly-2016-03-22
- beta
- stable
# Only while clippy is failing
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ libc = { version = "~0.2.8", optional = true }
ansi_term = { version = "~0.7.2", optional = true }
strsim = { version = "~0.4.0", optional = true }
yaml-rust = { version = "~0.3", optional = true }
clippy = { version = "~0.0.48", optional = true }
clippy = { version = "=0.0.55", optional = true }

[features]
default = ["suggestions", "color", "wrap_help"]
Expand Down
12 changes: 6 additions & 6 deletions src/app/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ impl<'b> Clone for AppMeta<'b> {
fn clone(&self) -> Self {
AppMeta {
name: self.name.clone(),
author: self.author.clone(),
about: self.about.clone(),
more_help: self.more_help.clone(),
version: self.version.clone(),
usage_str: self.usage_str.clone(),
author: self.author,
about: self.about,
more_help: self.more_help,
version: self.version,
usage_str: self.usage_str,
usage: self.usage.clone(),
bin_name: self.bin_name.clone(),
help_str: self.help_str.clone(),
help_str: self.help_str,
disp_ord: self.disp_ord,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1577,8 +1577,8 @@ impl<'a, 'b> Clone for Parser<'a, 'b> where 'a: 'b {
groups: self.groups.clone(),
global_args: self.global_args.clone(),
overrides: self.overrides.clone(),
help_short: self.help_short.clone(),
version_short: self.version_short.clone(),
help_short: self.help_short,
version_short: self.version_short,
settings: self.settings.clone(),
meta: self.meta.clone(),
}
Expand Down
1 change: 1 addition & 0 deletions src/args/arg_builder/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl<'n, 'e> AnyArg<'n, 'e> for OptBuilder<'n, 'e> {
fn overrides(&self) -> Option<&[&'e str]> { self.overrides.as_ref().map(|o| &o[..]) }
fn requires(&self) -> Option<&[&'e str]> { self.requires.as_ref().map(|o| &o[..]) }
fn blacklist(&self) -> Option<&[&'e str]> { self.blacklist.as_ref().map(|o| &o[..]) }
#[cfg_attr(feature = "lints", allow(map_clone))]
fn val_names(&self) -> Option<&VecMap<&'e str>> { self.val_names.as_ref().map(|o| o) }
fn is_set(&self, s: ArgSettings) -> bool { self.settings.is_set(s) }
fn has_switch(&self) -> bool { true }
Expand Down
8 changes: 7 additions & 1 deletion src/args/arg_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ use args::AnyArg;
#[allow(missing_debug_implementations)]
pub struct ArgMatcher<'a>(pub ArgMatches<'a>);

impl<'a> Default for ArgMatcher<'a> {
fn default() -> Self {
ArgMatcher(ArgMatches::default())
}
}

impl<'a> ArgMatcher<'a> {
pub fn new() -> Self {
ArgMatcher(ArgMatches::default())
ArgMatcher::default()
}

pub fn get_mut(&mut self, arg: &str) -> Option<&mut MatchedArg> {
Expand Down
14 changes: 5 additions & 9 deletions src/args/help_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ impl<'a, 'n, 'e, A> HelpWriter<'a, A> where A: AnyArg<'n, 'e> + Display {
}
write_spaces!(spcs, w);
}
} else {
if !(self.nlh || self.a.is_set(ArgSettings::NextLineHelp)) {
write_spaces!(self.l + 4 - (self.a.to_string().len()), w);
}
} else if !(self.nlh || self.a.is_set(ArgSettings::NextLineHelp)) {
write_spaces!(self.l + 4 - (self.a.to_string().len()), w);
}
Ok(())
}
Expand Down Expand Up @@ -219,12 +217,10 @@ impl<'a, 'n, 'e, A> HelpWriter<'a, A> where A: AnyArg<'n, 'e> + Display {
try!(write!(w, "\n"));
if self.nlh || self.a.is_set(ArgSettings::NextLineHelp) {
try!(write!(w, "{}{}", TAB, TAB));
} else if self.a.has_switch() {
write_spaces!(self.l + 12, w);
} else {
if self.a.has_switch() {
write_spaces!(self.l + 12, w);
} else {
write_spaces!(self.l + 8, w);
}
write_spaces!(self.l + 8, w);
}
try!(write!(w, "{}", part));
}
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@
trivial_casts,
trivial_numeric_casts,
unused_import_braces,
unused_allocation,
unused_qualifications)]
// clippy false positives, or ones we're ok with...
#![cfg_attr(feature = "lints", allow(cyclomatic_complexity))]
Expand Down

0 comments on commit 96869df

Please sign in to comment.