diff options
| author | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-05-26 00:21:20 +0200 |
|---|---|---|
| committer | Ada Alakbarova <ada.alakbarova@proton.me> | 2025-05-26 00:25:16 +0200 |
| commit | f04eb5984e779b9c5df79a26b8f94ab590409a9f (patch) | |
| tree | a86bd98be7a13d3cd28a80a72aea8adf4ee59803 | |
| parent | b72cb4847b340d90d73c825b6e0a03f634b45efd (diff) | |
| download | rust-f04eb5984e779b9c5df79a26b8f94ab590409a9f.tar.gz rust-f04eb5984e779b9c5df79a26b8f94ab590409a9f.zip | |
use if-let
| -rw-r--r-- | clippy_lints/src/operators/modulo_arithmetic.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/operators/modulo_arithmetic.rs b/clippy_lints/src/operators/modulo_arithmetic.rs index d4c6f5a2e12..44ac2a17e7e 100644 --- a/clippy_lints/src/operators/modulo_arithmetic.rs +++ b/clippy_lints/src/operators/modulo_arithmetic.rs @@ -41,7 +41,7 @@ fn used_in_comparison_with_zero(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { return false; }; - if op.node == BinOpKind::Eq || op.node == BinOpKind::Ne { + if let BinOpKind::Eq | BinOpKind::Ne = op.node { let ecx = ConstEvalCtxt::new(cx); matches!(ecx.eval(lhs), Some(Constant::Int(0))) || matches!(ecx.eval(rhs), Some(Constant::Int(0))) } else { |
