From 9047722838e4352d2a2af1125d1693b1900d3d5e Mon Sep 17 00:00:00 2001 From: LEXUGE Date: Thu, 5 Apr 2018 19:21:51 +0800 Subject: [PATCH] Update checked.rs --- src/ops/checked.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/ops/checked.rs b/src/ops/checked.rs index 5e6bb96..a0feca3 100644 --- a/src/ops/checked.rs +++ b/src/ops/checked.rs @@ -107,34 +107,6 @@ checked_impl!(CheckedRem, checked_rem, i32); checked_impl!(CheckedRem, checked_rem, i64); checked_impl!(CheckedRem, checked_rem, isize); -macro_rules! checked_abs_impl { - ($t:ty) => { - impl CheckedAbs for $t { - #[inline] - fn checked_abs(self) -> Option<$t> { - <$t>::checked_abs(self) - } - } - } -} - -// CheckedAbs -pub trait CheckedAbs: Sized { - fn checked_abs(self) -> Option; -} - -checked_abs_impl!(u8); -checked_abs_impl!(u16); -checked_abs_impl!(u32); -checked_abs_impl!(u64); -checked_abs_impl!(usize); - -checked_abs_impl!(i8); -checked_abs_impl!(i16); -checked_abs_impl!(i32); -checked_abs_impl!(i64); -checked_abs_impl!(isize); - /// Performs a left shift that returns `None` on overflow. pub trait CheckedShl: Sized + Shl { /// Shifts a number to the left, checking for overflow. If overflow happens,