Skip to content

Commit 79cd95c

Browse files
committed
Use match ergonomics for artithmetic lint
1 parent 0ddb628 commit 79cd95c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/arithmetic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
7373
return;
7474
}
7575
}
76-
match expr.node {
77-
hir::ExprKind::Binary(ref op, ref l, ref r) => {
76+
match &expr.node {
77+
hir::ExprKind::Binary(op, l, r) => {
7878
match op.node {
7979
hir::BinOpKind::And
8080
| hir::BinOpKind::Or
@@ -100,7 +100,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {
100100
self.expr_span = Some(expr.span);
101101
}
102102
},
103-
hir::ExprKind::Unary(hir::UnOp::UnNeg, ref arg) => {
103+
hir::ExprKind::Unary(hir::UnOp::UnNeg, arg) => {
104104
let ty = cx.tables.expr_ty(arg);
105105
if ty.is_integral() {
106106
span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");

0 commit comments

Comments
 (0)