diff --git a/src/writer.rs b/src/writer.rs index ed053d3e..481dbc88 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -79,7 +79,9 @@ impl Write for ZipWriter 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)),