Add assertions for state flags in finish_file

This commit is contained in:
Chris Hennick 2023-05-04 12:26:10 -07:00
parent ea25dbd954
commit 697578b38d
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -468,6 +468,8 @@ impl<W: Write + Seek> ZipWriter<W> {
fn finish_file(&mut self) -> ZipResult<()> {
if !self.writing_to_file {
debug_assert!(!self.writing_raw);
debug_assert!(!self.writing_to_extra_field);
return Ok(());
}
if self.writing_to_extra_field {