This is an automated email from the ASF dual-hosted git repository. mgrigorov pushed a commit to branch miniz_oxide_improvements in repository https://gitbox.apache.org/repos/asf/avro-rs.git
commit 8250126b95492dd7ac303d24117818a1001a4ec6 Author: Martin Tzvetanov Grigorov <[email protected]> AuthorDate: Mon Apr 7 11:25:00 2025 +0300 Issue #169 - Do not allow unused imports. Import only what is needed when it is needed Signed-off-by: Martin Tzvetanov Grigorov <[email protected]> --- avro/src/codec.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/avro/src/codec.rs b/avro/src/codec.rs index 599b59d..28f3a5e 100644 --- a/avro/src/codec.rs +++ b/avro/src/codec.rs @@ -17,8 +17,6 @@ //! Logic for all supported compression codecs in Avro. use crate::{types::Value, AvroResult, Error}; -#[allow(unused_imports)] // may be flagged as unused when only DEFLATE is enabled -use std::io::{Read, Write}; use strum_macros::{EnumIter, EnumString, IntoStaticStr}; /// The compression codec used to compress blocks. @@ -83,6 +81,7 @@ impl Codec { } #[cfg(feature = "zstandard")] Codec::Zstandard(settings) => { + use std::io::Write; let mut encoder = zstd::Encoder::new(Vec::new(), settings.compression_level as i32).unwrap(); encoder.write_all(stream).map_err(Error::ZstdCompress)?; @@ -91,6 +90,7 @@ impl Codec { #[cfg(feature = "bzip")] Codec::Bzip2(settings) => { use bzip2::read::BzEncoder; + use std::io::Read; let mut encoder = BzEncoder::new(&stream[..], settings.compression()); let mut buffer = Vec::new(); @@ -100,6 +100,7 @@ impl Codec { #[cfg(feature = "xz")] Codec::Xz(settings) => { use xz2::read::XzEncoder; + use std::io::Read; let mut encoder = XzEncoder::new(&stream[..], settings.compression_level as u32); let mut buffer = Vec::new(); @@ -168,6 +169,7 @@ impl Codec { #[cfg(feature = "bzip")] Codec::Bzip2(_) => { use bzip2::read::BzDecoder; + use std::io::Read; let mut decoder = BzDecoder::new(&stream[..]); let mut decoded = Vec::new(); @@ -177,6 +179,7 @@ impl Codec { #[cfg(feature = "xz")] Codec::Xz(_) => { use xz2::read::XzDecoder; + use std::io::Read; let mut decoder = XzDecoder::new(&stream[..]); let mut decoded: Vec<u8> = Vec::new();
