diff --git a/serde/src/de/from_primitive.rs b/serde/src/de/from_primitive.rs index 5230b18b..07646c91 100644 --- a/serde/src/de/from_primitive.rs +++ b/serde/src/de/from_primitive.rs @@ -39,12 +39,10 @@ macro_rules! uint_to { } pub trait FromPrimitive: Sized { - fn from_isize(n: isize) -> Option; fn from_i8(n: i8) -> Option; fn from_i16(n: i16) -> Option; fn from_i32(n: i32) -> Option; fn from_i64(n: i64) -> Option; - fn from_usize(n: usize) -> Option; fn from_u8(n: u8) -> Option; fn from_u16(n: u16) -> Option; fn from_u32(n: u32) -> Option; @@ -54,10 +52,6 @@ pub trait FromPrimitive: Sized { macro_rules! impl_from_primitive_for_int { ($t:ident) => { impl FromPrimitive for $t { - #[inline] - fn from_isize(n: isize) -> Option { - int_to_int!($t, n) - } #[inline] fn from_i8(n: i8) -> Option { int_to_int!($t, n) @@ -75,10 +69,6 @@ macro_rules! impl_from_primitive_for_int { int_to_int!($t, n) } #[inline] - fn from_usize(n: usize) -> Option { - uint_to!($t, n) - } - #[inline] fn from_u8(n: u8) -> Option { uint_to!($t, n) } @@ -101,10 +91,6 @@ macro_rules! impl_from_primitive_for_int { macro_rules! impl_from_primitive_for_uint { ($t:ident) => { impl FromPrimitive for $t { - #[inline] - fn from_isize(n: isize) -> Option { - int_to_uint!($t, n) - } #[inline] fn from_i8(n: i8) -> Option { int_to_uint!($t, n) @@ -122,10 +108,6 @@ macro_rules! impl_from_primitive_for_uint { int_to_uint!($t, n) } #[inline] - fn from_usize(n: usize) -> Option { - uint_to!($t, n) - } - #[inline] fn from_u8(n: u8) -> Option { uint_to!($t, n) } @@ -148,10 +130,6 @@ macro_rules! impl_from_primitive_for_uint { macro_rules! impl_from_primitive_for_float { ($t:ident) => { impl FromPrimitive for $t { - #[inline] - fn from_isize(n: isize) -> Option { - Some(n as Self) - } #[inline] fn from_i8(n: i8) -> Option { Some(n as Self) @@ -169,10 +147,6 @@ macro_rules! impl_from_primitive_for_float { Some(n as Self) } #[inline] - fn from_usize(n: usize) -> Option { - Some(n as Self) - } - #[inline] fn from_u8(n: u8) -> Option { Some(n as Self) }