Copilot commented on code in PR #174:
URL: https://github.com/apache/avro-rs/pull/174#discussion_r2030765808
##########
avro/src/codec.rs:
##########
@@ -60,8 +77,9 @@ impl Codec {
pub fn compress(self, stream: &mut Vec<u8>) -> AvroResult<()> {
match self {
Codec::Null => (),
- Codec::Deflate => {
- let compressed = miniz_oxide::deflate::compress_to_vec(stream,
6);
+ Codec::Deflate(settings) => {
+ let compressed =
+ miniz_oxide::deflate::compress_to_vec(stream,
settings.compression_level as u8);
Review Comment:
Casting the compression level enum to u8 may be brittle if the underlying
representation or expected type changes; consider adding a conversion method on
DeflateSettings to ensure safe and explicit conversion.
```suggestion
miniz_oxide::deflate::compress_to_vec(stream,
settings.to_u8());
```
--
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]