From 5935876f38498b0c1f657d031171eb17028def6f Mon Sep 17 00:00:00 2001 From: Alex Lyon Date: Tue, 23 Feb 2021 03:35:17 -0800 Subject: [PATCH] od: remove Vec::set_len() usage in InputDecoder (#1739) --- src/uu/od/src/inputdecoder.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/uu/od/src/inputdecoder.rs b/src/uu/od/src/inputdecoder.rs index 377f0c4efa4..3b36c28fb98 100644 --- a/src/uu/od/src/inputdecoder.rs +++ b/src/uu/od/src/inputdecoder.rs @@ -38,10 +38,7 @@ impl<'a, I> InputDecoder<'a, I> { peek_length: usize, byte_order: ByteOrder, ) -> InputDecoder { - let mut bytes: Vec = 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,