Skip to content

Commit dffc1b3

Browse files
committed
Apply clippy::useless_let_if_seq suggestion
1 parent 57bfb80 commit dffc1b3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/libcore/num/dec2flt/algorithm.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,12 @@ pub fn fast_path<T: RawFloat>(integral: &[u8], fractional: &[u8], e: i64) -> Opt
143143
/// > not a bound for the true error, but bounds the difference between the approximation z and
144144
/// > the best possible approximation that uses p bits of significand.)
145145
pub fn bellerophon<T: RawFloat>(f: &Big, e: i16) -> T {
146-
let slop;
147-
if f <= &Big::from_u64(T::MAX_SIG) {
146+
let slop = if f <= &Big::from_u64(T::MAX_SIG) {
148147
// The cases abs(e) < log5(2^N) are in fast_path()
149-
slop = if e >= 0 { 0 } else { 3 };
148+
if e >= 0 { 0 } else { 3 }
150149
} else {
151-
slop = if e >= 0 { 1 } else { 4 };
152-
}
150+
if e >= 0 { 1 } else { 4 }
151+
};
153152
let z = rawfp::big_to_fp(f).mul(&power_of_ten(e)).normalize();
154153
let exp_p_n = 1 << (P - T::SIG_BITS as u32);
155154
let lowbits: i64 = (z.f % exp_p_n) as i64;

0 commit comments

Comments
 (0)