Skip to content

Commit 56a001e

Browse files
committed
Fix clippy::manual_manual_range_contains
1 parent ad1ca2c commit 56a001e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
// Ratio ops often use other "suspicious" ops
2020
#![allow(clippy::suspicious_arithmetic_impl)]
2121
#![allow(clippy::suspicious_op_assign_impl)]
22-
// This uses stdlib features higher than the MSRV
23-
#![allow(clippy::manual_range_contains)] // 1.35
2422

2523
#[cfg(feature = "std")]
2624
#[macro_use]
@@ -1580,7 +1578,8 @@ fn ratio_to_f64<T: Bits + Clone + Integer + Signed + ShlAssign<usize> + ToPrimit
15801578
// FPU do the job is faster and easier. In any other case, converting to f64s may lead
15811579
// to an inexact result: https://stackoverflow.com/questions/56641441/.
15821580
if let (Some(n), Some(d)) = (numer.to_i64(), denom.to_i64()) {
1583-
if MIN_EXACT_INT <= n && n <= MAX_EXACT_INT && MIN_EXACT_INT <= d && d <= MAX_EXACT_INT {
1581+
let exact = MIN_EXACT_INT..=MAX_EXACT_INT;
1582+
if exact.contains(&n) && exact.contains(&d) {
15841583
return n.to_f64().unwrap() / d.to_f64().unwrap();
15851584
}
15861585
}

0 commit comments

Comments
 (0)