From c7db94aee6996b0b707cb8c0b912056c1ede6011 Mon Sep 17 00:00:00 2001 From: mcarton Date: Mon, 29 Feb 2016 17:48:20 +0100 Subject: [PATCH] Rustfmt --- src/blacklisted_name.rs | 9 +++++---- src/conf.rs | 13 ++++--------- src/types.rs | 4 +--- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/blacklisted_name.rs b/src/blacklisted_name.rs index 2d62cc44d26..25c0bac2c37 100644 --- a/src/blacklisted_name.rs +++ b/src/blacklisted_name.rs @@ -22,9 +22,7 @@ pub struct BlackListedName { impl BlackListedName { pub fn new(blacklist: Vec) -> BlackListedName { - BlackListedName { - blacklist: blacklist - } + BlackListedName { blacklist: blacklist } } } @@ -38,7 +36,10 @@ impl LateLintPass for BlackListedName { fn check_pat(&mut self, cx: &LateContext, pat: &Pat) { if let PatKind::Ident(_, ref ident, _) = pat.node { if self.blacklist.iter().any(|s| s == &*ident.node.name.as_str()) { - span_lint(cx, BLACKLISTED_NAME, pat.span, &format!("use of a blacklisted/placeholder name `{}`", ident.node.name)); + span_lint(cx, + BLACKLISTED_NAME, + pat.span, + &format!("use of a blacklisted/placeholder name `{}`", ident.node.name)); } } } diff --git a/src/conf.rs b/src/conf.rs index 3b2a1dafad4..0ceede3b5b8 100644 --- a/src/conf.rs +++ b/src/conf.rs @@ -19,7 +19,7 @@ pub fn conf_file(args: &[ptr::P]) -> Result Result<(), fmt::Error> { match *self { - ConfError::IoError(ref err) => { - err.fmt(f) - } + ConfError::IoError(ref err) => err.fmt(f), ConfError::TomlError(ref errs) => { let mut first = true; for err in errs { @@ -59,9 +57,7 @@ impl fmt::Display for ConfError { ConfError::TypeError(ref key, ref expected, ref got) => { write!(f, "`{}` is expected to be a `{}` but is a `{}`", key, expected, got) } - ConfError::UnknownKey(ref key) => { - write!(f, "unknown key `{}`", key) - } + ConfError::UnknownKey(ref key) => write!(f, "unknown key `{}`", key), } } } @@ -177,8 +173,7 @@ pub fn read_conf(path: &str, must_exist: bool) -> Result { let mut parser = toml::Parser::new(&file); let toml = if let Some(toml) = parser.parse() { toml - } - else { + } else { return Err(ConfError::TomlError(parser.errors)); }; diff --git a/src/types.rs b/src/types.rs index 1aefe5a4d27..e64bf010549 100644 --- a/src/types.rs +++ b/src/types.rs @@ -423,9 +423,7 @@ pub struct TypeComplexityPass { impl TypeComplexityPass { pub fn new(threshold: u64) -> Self { - TypeComplexityPass { - threshold: threshold - } + TypeComplexityPass { threshold: threshold } } }