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
Use distinct Flush types for Compress::compress vs Decompress::decompress #79
Comments
What would happen to the |
Eh I'd be fine with a bit of duplication in that respect @SamWhited, that's what we have tests for! |
I'm willing to take care of this. Here's my first pass at a design for this.
To add: My branch is here. I've implemented the design I laid out above, and all existing tests currently pass. |
I've been doing more investigation on this, and I have some observations. I've linked example code with it's output showing the behavior.
My question is, @alexcrichton, what would you like to do? I believe that code |
Thanks for taking this on @chrisvittal! Was gonna comment here but I'll go take a look at the PR instead :) |
Done in #109 |
Currently there is a single
flate2::Flush
type that is used by bothflate2::Compress::compress
andflate2::Decompress::decompress
.The methods are different in that
compress
supports Flush::None, Sync, Partial, Full, Finish whiledecompress
supports Flush::None, Sync, Finish. Neither method supports Flush::Block.It would be nicer to enforce these restrictions statically by having two different Flush types with only the variants that are allowed in each case.
The text was updated successfully, but these errors were encountered: