diff options
Diffstat (limited to 'src/libcore/num/u8.rs')
| -rw-r--r-- | src/libcore/num/u8.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/libcore/num/u8.rs b/src/libcore/num/u8.rs index a6df17956a1..00871a1c8fa 100644 --- a/src/libcore/num/u8.rs +++ b/src/libcore/num/u8.rs @@ -10,47 +10,5 @@ //! Operations and constants for unsigned 8-bits integers (`u8` type) -use default::Default; -use intrinsics; -use num::{Bitwise, Bounded, Zero, One, Unsigned, Num, Int, Primitive}; -use num::{CheckedAdd, CheckedSub, CheckedMul, CheckedDiv}; -use option::{Some, None, Option}; - -#[cfg(not(test))] -use cmp::{Eq, Ord, TotalEq, TotalOrd, Less, Greater, Equal, Ordering}; -#[cfg(not(test))] -use ops::{Add, Sub, Mul, Div, Rem, Neg, BitAnd, BitOr, BitXor}; -#[cfg(not(test))] -use ops::{Shl, Shr, Not}; - uint_module!(u8, i8, 8) -impl CheckedAdd for u8 { - #[inline] - fn checked_add(&self, v: &u8) -> Option<u8> { - unsafe { - let (x, y) = intrinsics::u8_add_with_overflow(*self, *v); - if y { None } else { Some(x) } - } - } -} - -impl CheckedSub for u8 { - #[inline] - fn checked_sub(&self, v: &u8) -> Option<u8> { - unsafe { - let (x, y) = intrinsics::u8_sub_with_overflow(*self, *v); - if y { None } else { Some(x) } - } - } -} - -impl CheckedMul for u8 { - #[inline] - fn checked_mul(&self, v: &u8) -> Option<u8> { - unsafe { - let (x, y) = intrinsics::u8_mul_with_overflow(*self, *v); - if y { None } else { Some(x) } - } - } -} |
