From 4dc7c2a986a15c129aecccdea334108d8e1df06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kr=C3=A1l?= Date: Tue, 18 May 2021 18:31:17 +0200 Subject: [PATCH] add comment in expand_strip() --- src/decoder/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index 43dccb0..173c4d5 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -1136,7 +1136,10 @@ impl Decoder { DecodingBuffer::F64(buf) => bytecast::f64_as_ne_mut_bytes(buf), }; + // Note that writing updates the slice to point to the yet unwritten part. std::io::copy(&mut reader.take(buffer.len() as u64), &mut buffer)?; + + // If less than the expected amount of bytes was read, set the remaining data to 0. for b in buffer { *b = 0; }