Remove a low-value assertion.

Checking that `read_raw_bytes(len)` changes the position by `len` is a
reasonable thing for a test, but isn't much use in just one of the
zillion `Decodable` impls.
This commit is contained in:
Nicholas Nethercote 2023-04-28 09:01:00 +10:00
parent 37c9e45186
commit fa133f5354

View File

@ -779,12 +779,7 @@ impl Encodable<FileEncoder> for IntEncodedWithFixedSize {
impl<'a> Decodable<MemDecoder<'a>> for IntEncodedWithFixedSize {
#[inline]
fn decode(decoder: &mut MemDecoder<'a>) -> IntEncodedWithFixedSize {
let _start_pos = decoder.position();
let bytes = decoder.read_raw_bytes(IntEncodedWithFixedSize::ENCODED_SIZE);
let value = u64::from_le_bytes(bytes.try_into().unwrap());
let _end_pos = decoder.position();
debug_assert_eq!((_end_pos - _start_pos), IntEncodedWithFixedSize::ENCODED_SIZE);
IntEncodedWithFixedSize(value)
let bytes = decoder.read_array::<{ IntEncodedWithFixedSize::ENCODED_SIZE }>();
IntEncodedWithFixedSize(u64::from_le_bytes(bytes))
}
}