From 8996249f2df511c142ab43eb22e21a868248df7a Mon Sep 17 00:00:00 2001 From: Riccardo Casatta Date: Tue, 29 Jun 2021 15:57:31 +0200 Subject: [PATCH] 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 --- src/consensus/encode.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/consensus/encode.rs b/src/consensus/encode.rs index f538f5b5..fc0bc1e7 100644 --- a/src/consensus/encode.rs +++ b/src/consensus/encode.rs @@ -336,7 +336,7 @@ macro_rules! impl_int_encodable{ impl Decodable for $ty { #[inline] fn consensus_decode(mut d: D) -> Result { - ReadExt::$meth_dec(&mut d).map($ty::from_le) + ReadExt::$meth_dec(&mut d) } } impl Encodable for $ty { @@ -345,7 +345,7 @@ macro_rules! impl_int_encodable{ &self, mut s: S, ) -> Result { - s.$meth_enc(self.to_le())?; + s.$meth_enc(*self)?; Ok(mem::size_of::<$ty>()) } }