Skip to content

Commit

Permalink
chore: Switch to ok_or_abort_file, and inline when that fails borro…
Browse files Browse the repository at this point in the history
…w checker
  • Loading branch information
Pr0methean committed Jun 15, 2024
1 parent e3ccaf6 commit c7116f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,9 +953,13 @@ impl<W: Write + Seek> ZipWriter<W> {
let extra_data_len = extra_data.len();
if extra_data_len > 0 {
let result = (|| {
ExtendedFileOptions::validate_extra_data(
&extra_data,
header_end - zip64_start,
)?;
writer.write_all(&extra_data)?;
extra_data_end = writer.stream_position()?;
ExtendedFileOptions::validate_extra_data(&extra_data, header_end - zip64_start)
Ok(())
})();
if let Err(e) = result {
let _ = self.abort_file();
Expand Down

0 comments on commit c7116f5

Please sign in to comment.