od: remove Vec::set_len() usage in InputDecoder (#1739)

This commit is contained in:
Alex Lyon
2021-02-23 12:35:17 +01:00
committed by GitHub
parent 7341a1a033
commit 5935876f38
+1 -4
View File
@@ -38,10 +38,7 @@ impl<'a, I> InputDecoder<'a, I> {
peek_length: usize,
byte_order: ByteOrder,
) -> InputDecoder<I> {
let mut bytes: Vec<u8> = Vec::with_capacity(normal_length + peek_length);
unsafe {
bytes.set_len(normal_length + peek_length);
} // fast but uninitialized
let bytes = vec![0; normal_length + peek_length];
InputDecoder {
input,