remove unneeded functions

This commit is contained in:
Trevor Spiteri 2019-01-31 02:57:55 +01:00
parent 5d543fef64
commit 91a4173669
3 changed files with 3 additions and 20 deletions

View File

@ -1537,10 +1537,10 @@ assert_eq!(Fix::saturating_from_float(f64::NEG_INFINITY), Fix::min_value());
if val.is_nan() {
panic!("NaN");
}
let saturated = if val.is_sign_positive() {
Self::max_value()
} else {
let saturated = if val.is_sign_negative() {
Self::min_value()
} else {
Self::max_value()
};
if !val.is_finite() {
return saturated;

View File

@ -34,7 +34,6 @@ pub trait SealedFloat: Copy + Debug + Display {
fn is_nan(self) -> bool;
fn is_finite(self) -> bool;
fn is_zero(self) -> bool;
fn is_sign_positive(self) -> bool;
fn is_sign_negative(self) -> bool;
fn parts(self) -> (bool, i32, Self::Bits);
@ -80,11 +79,6 @@ macro_rules! sealed_float {
(self.to_bits() & !Self::SIGN_MASK) == 0
}
#[inline]
fn is_sign_positive(self) -> bool {
(self.to_bits() & Self::SIGN_MASK) == 0
}
#[inline]
fn is_sign_negative(self) -> bool {
(self.to_bits() & Self::SIGN_MASK) != 0

View File

@ -29,7 +29,6 @@ pub trait SealedInt: Copy + Ord + Debug + Display {
fn one_shl(shift: u32) -> Self;
fn all_ones_shl(shift: u32) -> Self;
fn is_zero(self) -> bool;
fn is_positive(self) -> bool;
fn is_negative(self) -> bool;
fn to_fixed_overflow(
@ -67,11 +66,6 @@ macro_rules! sealed_int {
self == 0
}
#[inline]
fn is_positive(self) -> bool {
self > 0
}
$($rest)*
}
};
@ -221,11 +215,6 @@ impl SealedInt for bool {
!self
}
#[inline]
fn is_positive(self) -> bool {
self
}
#[inline]
fn is_negative(self) -> bool {
false