clippy
This commit is contained in:
parent
06388bfcee
commit
6fb791505b
8
build.rs
8
build.rs
|
@ -89,9 +89,11 @@ impl Environment {
|
|||
}
|
||||
}
|
||||
remove_dir_or_panic(&try_dir);
|
||||
if !found && !optional.0 {
|
||||
panic!("essential feature not supported by compiler: {}", name);
|
||||
}
|
||||
assert!(
|
||||
found || optional.0,
|
||||
"essential feature not supported by compiler: {}",
|
||||
name
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1064,9 +1064,7 @@ assert_eq!(Fix::MIN.saturating_div_euclid(Fix::from_num(0.25)), Fix::MIN);
|
|||
#[inline]
|
||||
#[must_use = "this returns the result of the operation, without modifying the original"]
|
||||
pub fn saturating_div_euclid(self, rhs: $Fixed<Frac>) -> $Fixed<Frac> {
|
||||
if rhs.to_bits() == 0 {
|
||||
panic!("division by zero");
|
||||
}
|
||||
assert!(rhs.to_bits() != 0, "division by zero");
|
||||
self.checked_div_euclid(rhs).unwrap_or_else(|| {
|
||||
if (self.to_bits() > 0) == (rhs.to_bits() > 0) {
|
||||
Self::MAX
|
||||
|
@ -1803,9 +1801,7 @@ acc.unwrapped_mul_acc(Fix::MAX, Fix::ONE);
|
|||
self.to_bits(),
|
||||
AFrac::I32 + BFrac::I32 - Frac::I32,
|
||||
);
|
||||
if overflow {
|
||||
panic!("overflow");
|
||||
}
|
||||
assert!(!overflow, "overflow");
|
||||
*self = Self::from_bits(ans);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2940,9 +2940,7 @@ let _overflow = Fix::MAX.unwrapped_inv_lerp::<U4>(Fix::ZERO, Fix::from_num(0.5))
|
|||
end.to_bits(),
|
||||
RetFrac::U32,
|
||||
);
|
||||
if overflow {
|
||||
panic!("overflow");
|
||||
}
|
||||
assert!(!overflow, "overflow");
|
||||
$Fixed::from_bits(bits)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue