Be explicit that we're handling bytes
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
parent
74b4eea64d
commit
fe2a867125
@ -570,7 +570,7 @@ pub fn write_target_uint(
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn read_target_uint(endianness: Endian, mut source: &[u8]) -> Result<u128, io::Error> {
|
pub fn read_target_uint(endianness: Endian, mut source: &[u8]) -> Result<u128, io::Error> {
|
||||||
let mut buf = [0; 16];
|
let mut buf = [0u8; std::mem::size_of::<u128>()];
|
||||||
source.read(&mut buf)?;
|
source.read(&mut buf)?;
|
||||||
match endianness {
|
match endianness {
|
||||||
Endian::Little => Ok(u128::from_le_bytes(buf)),
|
Endian::Little => Ok(u128::from_le_bytes(buf)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user