about summary refs log tree commit diff
path: root/clippy_lints/src/reference.rs
diff options
context:
space:
mode:
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-12-20 18:21:30 +0100
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>2016-12-20 18:21:30 +0100
commit4a4e1ea2c55b27b84a83fb2951ca6f192c55fc35 (patch)
tree616116c8911f48cbd056cf557f7ad03469211672 /clippy_lints/src/reference.rs
parent4d0864b27705cb9f8bc34808ceeabccee9360f25 (diff)
also run rustfmt on clippy-lints
Diffstat (limited to 'clippy_lints/src/reference.rs')
-rw-r--r--clippy_lints/src/reference.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs
index 19e8a3c7d14..7c5c5713550 100644
--- a/clippy_lints/src/reference.rs
+++ b/clippy_lints/src/reference.rs
@@ -1,4 +1,4 @@
-use syntax::ast::{Expr,ExprKind,UnOp};
+use syntax::ast::{Expr, ExprKind, UnOp};
 use rustc::lint::*;
 use utils::{span_lint_and_then, snippet};
 
@@ -40,15 +40,9 @@ impl EarlyLintPass for Pass {
     fn check_expr(&mut self, cx: &EarlyContext, e: &Expr) {
         if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.node {
             if let ExprKind::AddrOf(_, ref addrof_target) = without_parens(deref_target).node {
-                span_lint_and_then(
-                    cx,
-                    DEREF_ADDROF,
-                    e.span,
-                    "immediately dereferencing a reference",
-                    |db| {
-                        db.span_suggestion(e.span, "try this",
-                                             format!("{}", snippet(cx, addrof_target.span, "_")));
-                    });
+                span_lint_and_then(cx, DEREF_ADDROF, e.span, "immediately dereferencing a reference", |db| {
+                    db.span_suggestion(e.span, "try this", format!("{}", snippet(cx, addrof_target.span, "_")));
+                });
             }
         }
     }