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 {
|
||||
Result::Less
|
||||
} else if a_srep == b_srep {
|
||||
return Result::Equal;
|
||||
Result::Equal
|
||||
} else {
|
||||
return Result::Greater;
|
||||
}
|
||||
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! {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
// TODO: when `unsafe_block_in_unsafe_fn` is stabilized, remove this
|
||||
#![allow(unused_unsafe)]
|
||||
// The functions are complex with many branches, and explicit
|
||||
// `return`s makes it clear where function exit points are
|
||||
#![allow(clippy::needless_return)]
|
||||
#![allow(clippy::comparison_chain)]
|
||||
// Clippy is confused by the complex configuration
|
||||
#![allow(clippy::if_same_then_else)]
|
||||
#![allow(clippy::needless_bool)]
|
||||
|
||||
//! This `specialized_div_rem` module is originally from version 1.0.0 of the
|
||||
//! `specialized-div-rem` crate. Note that `for` loops with ranges are not used in this
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
// compiler on ABIs and such, so we should be "good enough" for now and changes
|
||||
// to the `u128` ABI will be reflected here.
|
||||
#![allow(improper_ctypes, improper_ctypes_definitions)]
|
||||
// `mem::swap` cannot be used because it may generate references to memcpy in unoptimized code.
|
||||
#![allow(clippy::manual_swap)]
|
||||
|
||||
// We disable #[no_mangle] for tests so that we can verify the test results
|
||||
// against the native compiler-rt implementations of the builtins.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Trying to satisfy clippy here is hopeless
|
||||
#![allow(clippy::style)]
|
||||
|
||||
#[allow(warnings)]
|
||||
#[cfg(target_pointer_width = "16")]
|
||||
type c_int = i16;
|
||||
|
||||
Reference in New Issue
Block a user