Skip to content

Commit ec0456a

Browse files
committed
Use existing macros to implement 128-bit From impls
1 parent c183125 commit ec0456a

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/number.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -732,19 +732,8 @@ impl_from_signed!(i8, i16, i32, i64, isize);
732732

733733
#[cfg(feature = "arbitrary_precision")]
734734
serde_if_integer128! {
735-
impl From<i128> for Number {
736-
fn from(i: i128) -> Self {
737-
let n = itoa::Buffer::new().format(i).to_owned();
738-
Number { n }
739-
}
740-
}
741-
742-
impl From<u128> for Number {
743-
fn from(u: u128) -> Self {
744-
let n = itoa::Buffer::new().format(u).to_owned();
745-
Number { n }
746-
}
747-
}
735+
impl_from_unsigned!(u128);
736+
impl_from_signed!(i128);
748737
}
749738

750739
impl Number {

0 commit comments

Comments
 (0)