You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "martin-g (via GitHub)" <gi...@apache.org> on 2025/04/07 08:51:17 UTC
[PR] Add Codec::Deflate settings [avro-rs]
martin-g opened a new pull request, #174:
URL: https://github.com/apache/avro-rs/pull/174
(no comment)
--
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: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat: Add settings for Codec::Deflate [avro-rs]
Posted by "martin-g (via GitHub)" <gi...@apache.org>.
martin-g merged PR #174:
URL: https://github.com/apache/avro-rs/pull/174
--
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: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Codec::Deflate settings [avro-rs]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org