File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments