chore: Switch to ok_or_abort_file
, and inline when that fails borrow checker
This commit is contained in:
parent
e3ccaf6e00
commit
c7116f54d6
1 changed files with 5 additions and 1 deletions
|
@ -953,9 +953,13 @@ impl<W: Write + Seek> ZipWriter<W> {
|
||||||
let extra_data_len = extra_data.len();
|
let extra_data_len = extra_data.len();
|
||||||
if extra_data_len > 0 {
|
if extra_data_len > 0 {
|
||||||
let result = (|| {
|
let result = (|| {
|
||||||
|
ExtendedFileOptions::validate_extra_data(
|
||||||
|
&extra_data,
|
||||||
|
header_end - zip64_start,
|
||||||
|
)?;
|
||||||
writer.write_all(&extra_data)?;
|
writer.write_all(&extra_data)?;
|
||||||
extra_data_end = writer.stream_position()?;
|
extra_data_end = writer.stream_position()?;
|
||||||
ExtendedFileOptions::validate_extra_data(&extra_data, header_end - zip64_start)
|
Ok(())
|
||||||
})();
|
})();
|
||||||
if let Err(e) = result {
|
if let Err(e) = result {
|
||||||
let _ = self.abort_file();
|
let _ = self.abort_file();
|
||||||
|
|
Loading…
Add table
Reference in a new issue