Close the writer on flush
This commit is contained in:
parent
51c55d30b3
commit
b4ccb46389
1 changed files with 3 additions and 1 deletions
|
@ -79,7 +79,9 @@ impl<W: Write+io::Seek> Write for ZipWriter<W>
|
|||
|
||||
fn flush(&mut self) -> io::Result<()>
|
||||
{
|
||||
match self.finalize() {
|
||||
let result = self.finalize();
|
||||
self.inner = GenericZipWriter::Closed;
|
||||
match result {
|
||||
Ok(..) => Ok(()),
|
||||
Err(ZipError::Io(io_err)) => Err(io_err),
|
||||
Err(..) => Err(io::Error::new(io::ErrorKind::Other, "Error occured during finalization", None)),
|
||||
|
|
Loading…
Add table
Reference in a new issue