Skip to content

feat: Add settings for Codec::Deflate - #174

Merged
martin-g merged 8 commits into
mainfrom
miniz_oxide_improvements
Apr 9, 2025
Merged

martin-g merged 8 commits into
mainfrom
miniz_oxide_improvements

Conversation

@martin-g

@martin-g martin-g commented Apr 7, 2025

Copy link
Copy Markdown
Member

No description provided.

martin-g added 4 commits April 7, 2025 11:19
…when it is needed

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
At the moment it could be used to specify the compression level for
Codec::Deflate

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Add some Rustdoc

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread avro/src/codec.rs Outdated
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);

Copilot AI Apr 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
miniz_oxide::deflate::compress_to_vec(stream, settings.compression_level as u8);
miniz_oxide::deflate::compress_to_vec(stream, settings.to_u8());

Copilot uses AI. Check for mistakes.
martin-g added 4 commits April 7, 2025 11:52
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
…el to u8

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
@martin-g martin-g changed the title Add Codec::Deflate settings feat: Add Codec::Deflate settings Apr 7, 2025
@martin-g martin-g changed the title feat: Add Codec::Deflate settings feat: Add settings for Codec::Deflate Apr 7, 2025
@martin-g
martin-g merged commit 68a4f2e into main Apr 9, 2025
@martin-g
martin-g deleted the miniz_oxide_improvements branch April 9, 2025 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants