-
Notifications
You must be signed in to change notification settings - Fork 102
feat: allow reading uncompressed size #396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
82a6995 to
30e2a2b
Compare
NobodyXu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, one suggestion for the API
30e2a2b to
08fb5a6
Compare
|
Changed. |
|
Yeah putting it in a separate trait sounds reasonable, and , I suggest we could name it trait DecodedSize {
fn get_decoded_size(input: &[u8]) -> Result<usize>;
}
}I also notice that this function does not depend on the state of decoder, so we should make that clear. We could also just expose it as a regular function |
Adds a new trait that to retrieve the size of the data when uncompressed. The implementation of this trait on a format indicates that a format may support retrieving the uncompressed size, however it's not guaranteed.
04856e1 to
dc031f3
Compare
dc031f3 to
0738561
Compare
Not for the ones I implemented, but I didn't want to force a breaking change when adding other/future formats (for example
I think a trait works better here, as that allows it to be used in trait bounds. |
NobodyXu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm currently working on refactoring on this repo, so I planned to cut a new release in at least one week's time
If you need it now, I can try to cut a release this week instead
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #396 +/- ##
===========================
===========================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, I'm happy to wait (or use a git commit :)) |
Implements support for reading the uncompressed size without decompressing the input. As this is not supported by all formats,
Nonemay be returned.