fix: Restore methods for AutoFinishGzEncoder
Co-authored-by: aider (openai/andrew/openrouter/sonoma-sky-alpha) <aider@aider.chat>
This commit is contained in:
@@ -75,4 +75,22 @@ impl<W: Write> AutoFinishGzEncoder<W> {
|
||||
}
|
||||
|
||||
#[cfg(feature = "gzip")]
|
||||
impl<W: Write> Drop for AutoFinishGz
|
||||
impl<W: Write> Drop for AutoFinishGzEncoder<W> {
|
||||
fn drop(&mut self) {
|
||||
if let Some(encoder) = self.encoder.take() {
|
||||
debug!("COMPRESSION: Finishing");
|
||||
let _ = encoder.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gzip")]
|
||||
impl<W: Write> Write for AutoFinishGzEncoder<W> {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
self.encoder.as_mut().unwrap().write(buf)
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
self.encoder.as_mut().unwrap().flush()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user