From b4ccb46389dc0295ddd24c1097ccc388d9eb69e8 Mon Sep 17 00:00:00 2001 From: Mathijs van de Nes Date: Tue, 24 Feb 2015 19:06:19 +0100 Subject: [PATCH] Close the writer on flush --- src/writer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)),