diff --git a/clippy_lints/src/reference.rs b/clippy_lints/src/reference.rs index 0d4332b4a..ffdb02216 100644 --- a/clippy_lints/src/reference.rs +++ b/clippy_lints/src/reference.rs @@ -38,8 +38,10 @@ fn without_parens(mut e: &Expr) -> &Expr { 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 { + if_chain! { + if let ExprKind::Unary(UnOp::Deref, ref deref_target) = e.node; + if let ExprKind::AddrOf(_, ref addrof_target) = without_parens(deref_target).node; + then { span_lint_and_sugg( cx, DEREF_ADDROF,