about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2018-12-29 17:27:26 +0100
committerKonrad Borowski <konrad@borowski.pw>2018-12-29 17:27:26 +0100
commit3bf71a8e6286b647bef901b95c031968a9b76b68 (patch)
tree42647bf131281708d53513fca65736de620441b9
parent79cd95cf35a09489da02f7948886c6a736503606 (diff)
downloadrust-3bf71a8e6286b647bef901b95c031968a9b76b68.tar.gz
rust-3bf71a8e6286b647bef901b95c031968a9b76b68.zip
Use match ergonomics for assign_ops lint
-rw-r--r--clippy_lints/src/assign_ops.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/clippy_lints/src/assign_ops.rs b/clippy_lints/src/assign_ops.rs
index f69c66a3d35..c7b45edb521 100644
--- a/clippy_lints/src/assign_ops.rs
+++ b/clippy_lints/src/assign_ops.rs
@@ -70,9 +70,9 @@ impl LintPass for AssignOps {
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
     fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
-        match expr.node {
-            hir::ExprKind::AssignOp(op, ref lhs, ref rhs) => {
-                if let hir::ExprKind::Binary(binop, ref l, ref r) = rhs.node {
+        match &expr.node {
+            hir::ExprKind::AssignOp(op, lhs, rhs) => {
+                if let hir::ExprKind::Binary(binop, l, r) = &rhs.node {
                     if op.node == binop.node {
                         let lint = |assignee: &hir::Expr, rhs_other: &hir::Expr| {
                             span_lint_and_then(
@@ -122,8 +122,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
                     }
                 }
             },
-            hir::ExprKind::Assign(ref assignee, ref e) => {
-                if let hir::ExprKind::Binary(op, ref l, ref r) = e.node {
+            hir::ExprKind::Assign(assignee, e) => {
+                if let hir::ExprKind::Binary(op, l, r) = &e.node {
                     #[allow(clippy::cyclomatic_complexity)]
                     let lint = |assignee: &hir::Expr, rhs: &hir::Expr| {
                         let ty = cx.tables.expr_ty(assignee);
@@ -150,8 +150,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
                                         if_chain! {
                                             if parent_impl != ast::CRATE_NODE_ID;
                                             if let hir::Node::Item(item) = cx.tcx.hir().get(parent_impl);
-                                            if let hir::ItemKind::Impl(_, _, _, _, Some(ref trait_ref), _, _) =
-                                                item.node;
+                                            if let hir::ItemKind::Impl(_, _, _, _, Some(trait_ref), _, _) =
+                                                &item.node;
                                             if trait_ref.path.def.def_id() == trait_id;
                                             then { return; }
                                         }