-
Notifications
You must be signed in to change notification settings - Fork 35
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
impl Drop #12
Comments
Thanks for your advice. It seems useful. |
I reverted the above commit because implementing Instead, I tried adding It can be used as follows: use libflate::finish::AutoFinish;
fn make_writer_object() -> Box<Write> {
let stdout = io::stdout();
let buf_stdout = io::BufWriter::new(stdout);
let gzip = gzip::Encoder::new(buf_stdout).unwrap();
Box::new(AutoFinish::new(gzip))
} |
For comparison I've also been using Anyway, are you interested in help API with development? I had some ideas about unifying blocking/non-blocking code and supporting concatenated streams. I'm not interested in the underlying compression details, but I do like fiddling with APIs. |
Thank you for the information. It seems okay to implement the
Great! Your contributions are welcome. |
Sorry for bumping this old issue! But did it eventually land somewhere inside a new version? I see that the 0.2.0 is not yet released right? I am not sure if it was incorporated in another version? |
@DevQps Thanks for your question. This feature has not been merged into |
@sile Alright! Thanks for informing us! If there is anything else I can do, feel free to contact! |
@DevQps To be honest, I forgot about this feature. If you need it, I will consider it again, but what about it? |
@sile No problem! I personally don't need it, so I am not sure whether it would be best to just leave it open for someone to potentially pick this up, or to just close it since it's so old. But I'll leave that up to you! :) |
@DevQps I see, thanks! I will keep this PR open. |
The
Encoder
s should haveimpl Drop
that finishes the compressed stream upondrop()
.BufWriter
does something similar (flushes its buffer upondrop()
).My use case is
Write
trait objects. Consider the following trait object that writes compressed output tostdout
...This doesn't work because the last bit of compressed data gets cut off.
The text was updated successfully, but these errors were encountered: