Fix all clippy warnings
This commit is contained in:
@@ -137,9 +137,8 @@ where
|
||||
a_significand <<= shift;
|
||||
a_exponent -= shift;
|
||||
}
|
||||
} else
|
||||
/* addition */
|
||||
{
|
||||
} else {
|
||||
// addition
|
||||
a_significand += b_significand;
|
||||
|
||||
// If the addition carried up, we need to right-shift the result and
|
||||
|
||||
@@ -63,25 +63,22 @@ fn cmp<F: Float>(a: F, b: F) -> Result {
|
||||
// a and b as signed integers as we would with a fp_ting-point compare.
|
||||
if a_srep & b_srep >= szero {
|
||||
if a_srep < b_srep {
|
||||
return Result::Less;
|
||||
Result::Less
|
||||
} else if a_srep == b_srep {
|
||||
return Result::Equal;
|
||||
Result::Equal
|
||||
} else {
|
||||
return Result::Greater;
|
||||
Result::Greater
|
||||
}
|
||||
}
|
||||
// Otherwise, both are negative, so we need to flip the sense of the
|
||||
// comparison to get the correct result. (This assumes a twos- or ones-
|
||||
// complement integer representation; if integers are represented in a
|
||||
// sign-magnitude representation, then this flip is incorrect).
|
||||
else {
|
||||
if a_srep > b_srep {
|
||||
return Result::Less;
|
||||
} else if a_srep == b_srep {
|
||||
return Result::Equal;
|
||||
} else {
|
||||
return Result::Greater;
|
||||
}
|
||||
} else if a_srep > b_srep {
|
||||
Result::Less
|
||||
} else if a_srep == b_srep {
|
||||
Result::Equal
|
||||
} else {
|
||||
Result::Greater
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// The functions are complex with many branches, and explicit
|
||||
// `return`s makes it clear where function exit points are
|
||||
#![allow(clippy::needless_return)]
|
||||
|
||||
use float::Float;
|
||||
use int::{CastInto, DInt, HInt, Int};
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ where
|
||||
product_high += product_high & one;
|
||||
}
|
||||
|
||||
return F::from_repr(product_high);
|
||||
F::from_repr(product_high)
|
||||
}
|
||||
|
||||
intrinsics! {
|
||||
|
||||
Reference in New Issue
Block a user