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:
parent
abff973e83
commit
8996249f2d
|
@ -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>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue