martin-g commented on code in PR #2455:
URL: https://github.com/apache/avro/pull/2455#discussion_r1298838511


##########
lang/rust/avro/src/codec.rs:
##########
@@ -82,18 +82,16 @@ impl Codec {
             }
             #[cfg(feature = "snappy")]
             Codec::Snappy => {
-                use byteorder::ByteOrder;
-
                 let mut encoded: Vec<u8> = vec![0; 
snap::raw::max_compress_len(stream.len())];
                 let compressed_size = snap::raw::Encoder::new()
                     .compress(&stream[..], &mut encoded[..])
                     .map_err(Error::SnappyCompress)?;
+                encoded.truncate(compressed_size);

Review Comment:
   Good suggestion! Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to