mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-28 15:43:21 +00:00
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:
parent
37c9e45186
commit
fa133f5354
@ -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))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user