remove {to/from}_le from impl_int_encodable

they are a noop on little-endian and the following {to/from}_array_le are sufficient to deal with big-endian
This commit is contained in:
Riccardo Casatta 2021-06-29 15:57:31 +02:00
parent abff973e83
commit 8996249f2d
No known key found for this signature in database
GPG Key ID: FD986A969E450397
1 changed files with 2 additions and 2 deletions

View File

@ -336,7 +336,7 @@ macro_rules! impl_int_encodable{
impl Decodable for $ty { impl Decodable for $ty {
#[inline] #[inline]
fn consensus_decode<D: io::Read>(mut d: D) -> Result<Self, Error> { fn consensus_decode<D: io::Read>(mut d: D) -> Result<Self, Error> {
ReadExt::$meth_dec(&mut d).map($ty::from_le) ReadExt::$meth_dec(&mut d)
} }
} }
impl Encodable for $ty { impl Encodable for $ty {
@ -345,7 +345,7 @@ macro_rules! impl_int_encodable{
&self, &self,
mut s: S, mut s: S,
) -> Result<usize, io::Error> { ) -> Result<usize, io::Error> {
s.$meth_enc(self.to_le())?; s.$meth_enc(*self)?;
Ok(mem::size_of::<$ty>()) Ok(mem::size_of::<$ty>())
} }
} }