Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Make `DecompressError` implement the `Error` trait #122

Closed Shnatsel closed 1 year ago

Shnatsel commented 1 year ago

Right now the DecompressError returned by decompress_to_vec* family of functions does not implement the Error trait. This makes working with it rather unwieldy, and requires the user to write their own messages for every value of TINFLStatus if they wish to display the error to the user.

oyvindln commented 1 year ago

Yeah I left that out for now as I wasn't quite sure how to handle that with no_std etc, but it really should.

oyvindln commented 1 year ago

Looks like adding a "std" feature which could or could not be enabled per default might be the best option. Not sure if adding it as a default without a major version bump would be fine or if it should not be default for now.

https://www.reddit.com/r/rust/comments/liv2ib/no_std_with_error_trait/

oyvindln commented 1 year ago

Added in c52cf711db0dcf38481c7e5e79d4fd60b09728b5