Skip to content

Commit 60dbda2

Browse files
authored
fix typo in numeric_arithmetic logic (#13820)
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
2 parents b8e569e + db35e30 commit 60dbda2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/operators/numeric_arithmetic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ impl Context {
4343
_ => (),
4444
}
4545

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

0 commit comments

Comments
 (0)