From 79cd95cf35a09489da02f7948886c6a736503606 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Sat, 29 Dec 2018 17:25:45 +0100 Subject: [PATCH] Use match ergonomics for artithmetic lint --- clippy_lints/src/arithmetic.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/arithmetic.rs b/clippy_lints/src/arithmetic.rs index 0b2c00b9b58..a9b61d328e4 100644 --- a/clippy_lints/src/arithmetic.rs +++ b/clippy_lints/src/arithmetic.rs @@ -73,8 +73,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic { return; } } - match expr.node { - hir::ExprKind::Binary(ref op, ref l, ref r) => { + match &expr.node { + hir::ExprKind::Binary(op, l, r) => { match op.node { hir::BinOpKind::And | hir::BinOpKind::Or @@ -100,7 +100,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic { self.expr_span = Some(expr.span); } }, - hir::ExprKind::Unary(hir::UnOp::UnNeg, ref arg) => { + hir::ExprKind::Unary(hir::UnOp::UnNeg, arg) => { let ty = cx.tables.expr_ty(arg); if ty.is_integral() { span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");