Revert #[inline] hints

This commit is contained in:
Yoan Lecoq 2017-04-30 08:32:25 +02:00
parent 81aa6dbe48
commit f4e0b47ceb
4 changed files with 4 additions and 12 deletions

View File

@ -388,12 +388,12 @@ impl_from_primitive!(f64, to_f64);
impl<T: ToPrimitive> ToPrimitive for Wrapping<T> {
#[inline] fn to_i64(&self) -> Option<i64> { self.0.to_i64() }
#[inline] fn to_u64(&self) -> Option<u64> { self.0.to_u64() }
fn to_i64(&self) -> Option<i64> { self.0.to_i64() }
fn to_u64(&self) -> Option<u64> { self.0.to_u64() }
}
impl<T: FromPrimitive> FromPrimitive for Wrapping<T> {
#[inline] fn from_u64(n: u64) -> Option<Self> { T::from_u64(n).map(Wrapping) }
#[inline] fn from_i64(n: i64) -> Option<Self> { T::from_i64(n).map(Wrapping) }
fn from_u64(n: u64) -> Option<Self> { T::from_u64(n).map(Wrapping) }
fn from_i64(n: i64) -> Option<Self> { T::from_i64(n).map(Wrapping) }
}
@ -447,7 +447,6 @@ impl_num_cast!(f32, to_f32);
impl_num_cast!(f64, to_f64);
impl<T: NumCast> NumCast for Wrapping<T> {
#[inline]
fn from<U: ToPrimitive>(n: U) -> Option<Self> {
T::from(n).map(Wrapping)
}

View File

@ -52,11 +52,9 @@ zero_impl!(f32, 0.0f32);
zero_impl!(f64, 0.0f64);
impl<T: Zero> Zero for Wrapping<T> where Wrapping<T>: Add<Output=Wrapping<T>> {
#[inline]
fn is_zero(&self) -> bool {
self.0.is_zero()
}
#[inline]
fn zero() -> Self {
Wrapping(T::zero())
}
@ -108,7 +106,6 @@ one_impl!(f32, 1.0f32);
one_impl!(f64, 1.0f64);
impl<T: One> One for Wrapping<T> where Wrapping<T>: Mul<Output=Wrapping<T>> {
#[inline]
fn one() -> Self {
Wrapping(T::one())
}

View File

@ -81,7 +81,6 @@ impl<T: Num> Num for Wrapping<T>
+ Mul<Output = Wrapping<T>> + Div<Output = Wrapping<T>> + Rem<Output = Wrapping<T>>
{
type FromStrRadixErr = T::FromStrRadixErr;
#[inline]
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr> {
T::from_str_radix(str, radix).map(Wrapping)
}

View File

@ -79,19 +79,16 @@ wrapping_impl!(WrappingMul, wrapping_mul, isize);
// Well this is a bit funny, but all the more appropriate.
impl<T: WrappingAdd> WrappingAdd for Wrapping<T> where Wrapping<T>: Add<Output = Wrapping<T>> {
#[inline]
fn wrapping_add(&self, v: &Self) -> Self {
Wrapping(self.0.wrapping_add(&v.0))
}
}
impl<T: WrappingSub> WrappingSub for Wrapping<T> where Wrapping<T>: Sub<Output = Wrapping<T>> {
#[inline]
fn wrapping_sub(&self, v: &Self) -> Self {
Wrapping(self.0.wrapping_sub(&v.0))
}
}
impl<T: WrappingMul> WrappingMul for Wrapping<T> where Wrapping<T>: Mul<Output = Wrapping<T>> {
#[inline]
fn wrapping_mul(&self, v: &Self) -> Self {
Wrapping(self.0.wrapping_mul(&v.0))
}