Skip to content

Commit db2efb0

Browse files
committed
Combine impl_int and impl_uint
Two macros are exactly the same.
1 parent 76342d9 commit db2efb0

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

core/src/fmt/num.rs

+4-15
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,11 @@ macro_rules! impl_int {
3131
})*
3232
)
3333
}
34-
macro_rules! impl_uint {
35-
($($t:ident)*) => (
36-
$(impl DisplayInt for $t {
37-
fn zero() -> Self { 0 }
38-
fn from_u8(u: u8) -> Self { u as Self }
39-
fn to_u8(&self) -> u8 { *self as u8 }
40-
#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32")))]
41-
fn to_u32(&self) -> u32 { *self as u32 }
42-
fn to_u64(&self) -> u64 { *self as u64 }
43-
fn to_u128(&self) -> u128 { *self as u128 }
44-
})*
45-
)
46-
}
4734

48-
impl_int! { i8 i16 i32 i64 i128 isize }
49-
impl_uint! { u8 u16 u32 u64 u128 usize }
35+
impl_int! {
36+
i8 i16 i32 i64 i128 isize
37+
u8 u16 u32 u64 u128 usize
38+
}
5039

5140
/// A type that represents a specific radix
5241
///

0 commit comments

Comments
 (0)