This commit is contained in:
Chris Hennick 2023-05-01 15:35:36 -07:00
parent e75527ffc7
commit 5220222f84
No known key found for this signature in database
GPG key ID: 25653935CC8B6C74

View file

@ -104,12 +104,13 @@ fn do_operation<T>(writer: &mut zip_next::ZipWriter<T>,
FileOperation::WriteLarge {file, mut options} => { FileOperation::WriteLarge {file, mut options} => {
options = options.large_file(true); options = options.large_file(true);
writer.start_file(file.name.to_owned(), options)?; writer.start_file(file.name.to_owned(), options)?;
let written: usize = 0; let mut written: usize = 0;
while written < LARGE_FILE_BUF_SIZE { while written < LARGE_FILE_BUF_SIZE {
for chunk in &file.large_contents { for chunk in &file.large_contents {
let chunk: Vec<u8> = chunk.to_owned().into_iter() let chunk: Vec<u8> = chunk.to_owned().into_iter()
.flat_map(RepeatedBytes::into_iter) .flat_map(RepeatedBytes::into_iter)
.collect(); .collect();
written += chunk.len();
writer.write_all(chunk.as_slice())?; writer.write_all(chunk.as_slice())?;
} }
} }