Skip to content

Commit f04eb59

Browse files
committed
use if-let
1 parent b72cb48 commit f04eb59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/operators/modulo_arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn used_in_comparison_with_zero(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
4141
return false;
4242
};
4343

44-
if op.node == BinOpKind::Eq || op.node == BinOpKind::Ne {
44+
if let BinOpKind::Eq | BinOpKind::Ne = op.node {
4545
let ecx = ConstEvalCtxt::new(cx);
4646
matches!(ecx.eval(lhs), Some(Constant::Int(0))) || matches!(ecx.eval(rhs), Some(Constant::Int(0)))
4747
} else {

0 commit comments

Comments
 (0)