Skip to content

Commit

Permalink
fix typo in numeric_arithmetic logic (#13820)
Browse files Browse the repository at this point in the history
Looks like typo for me.

Looking at blame
b76b0ae#diff-ac15e787d7d276b24f251f4f5bdedf1e6ac81aa1e2ea0db27219e9a7fa8b0b30L66
the same typo was before.

Is logic here actually correct? Tests passed locally, but i expected
some changes.

changelog: none
  • Loading branch information
y21 authored Dec 15, 2024
2 parents b8e569e + db35e30 commit 60dbda2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/operators/numeric_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ impl Context {
_ => (),
}

let (_, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
if r_ty.peel_refs().is_floating_point() && r_ty.peel_refs().is_floating_point() {
let (l_ty, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
if l_ty.peel_refs().is_floating_point() && r_ty.peel_refs().is_floating_point() {
span_lint(cx, FLOAT_ARITHMETIC, expr.span, "floating-point arithmetic detected");
self.expr_id = Some(expr.hir_id);
}
Expand Down

0 comments on commit 60dbda2

Please sign in to comment.