-
Notifications
You must be signed in to change notification settings - Fork 15
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
finish ergonomics #4
Comments
I agree partly. Of course it is cumbersome to call |
Also the only way to react on errors in |
Maybe you could add a feature "finish_on_drop" or something like that. |
Right now,
finish
needs to be called on an LzmaWriter to get it to finish compressing/decompressing. This differs from the way a normalWrite
-like object works, so it's easy to forget and cause weird bugs.Investigate the suggestion of using
Drop
to either callfinish
or panic iffinish
hasn't been called.BufWriter
implementsDrop
like this: https://static.rust-lang.org/doc/master/src/std/io/buffered.rs.html#501-509Credits to krdln for the feedback.
The text was updated successfully, but these errors were encountered: