diff --git a/src/lib.rs b/src/lib.rs index c28524e..be47833 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -74,10 +74,10 @@ pub struct BigEndian(T); impl Endian for BigEndian{} macro_rules! impl_for_BigEndian{ ( $t:ident ) => { - impl Into<$t> for BigEndian<$t>{ + impl From> for $t { #[inline] - fn into(self) -> $t{ - $t::from_be(self.0) + fn from(data: BigEndian<$t>) -> $t { + $t::from_be(data.0) } } @@ -116,10 +116,10 @@ pub struct LittleEndian(T); impl Endian for LittleEndian{} macro_rules! impl_for_LittleEndian{ ( $t:ident ) => { - impl Into<$t> for LittleEndian<$t>{ + impl From> for $t { #[inline] - fn into(self) -> $t{ - $t::from_le(self.0) + fn from(data: LittleEndian<$t>) -> $t { + $t::from_le(data.0) } }