vecdb/variants/eager/checked_sub.rs
1pub trait CheckedSub<Rhs = Self>: Sized {
2 fn checked_sub(self, rhs: Rhs) -> Option<Self>;
3}
4
5macro_rules! impl_checked_sub {
6 ($($t:ty)*) => ($(
7 impl CheckedSub for $t {
8 #[inline]
9 fn checked_sub(self, rhs: Self) -> Option<Self> {
10 <$t>::checked_sub(self, rhs)
11 }
12 }
13 )*)
14}
15
16impl_checked_sub! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }