also run rustfmt on clippy-lints
This commit is contained in:
parent
4d0864b277
commit
4a4e1ea2c5
72 changed files with 1017 additions and 1204 deletions
|
@ -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, "_")));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue