chore: Fix build
This commit is contained in:
parent
cb2d7abde7
commit
19118f45f3
2 changed files with 8 additions and 8 deletions
|
@ -810,13 +810,13 @@ impl<R: Read + Seek> ZipArchive<R> {
|
||||||
///
|
///
|
||||||
/// This uses the central directory record of the ZIP file, and ignores local file headers.
|
/// This uses the central directory record of the ZIP file, and ignores local file headers.
|
||||||
pub fn with_config(config: Config, mut reader: R) -> ZipResult<ZipArchive<R>> {
|
pub fn with_config(config: Config, mut reader: R) -> ZipResult<ZipArchive<R>> {
|
||||||
let results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut reader)?;
|
let mut results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut reader)?;
|
||||||
for (footer, cde_start_pos) in results {
|
for (footer, cde_start_pos) in results.iter_mut() {
|
||||||
if let Ok(shared) = Self::get_metadata(config, &mut reader, &footer, cde_start_pos) {
|
if let Ok(shared) = Self::get_metadata(config, &mut reader, &footer, *cde_start_pos) {
|
||||||
return Ok(ZipArchive {
|
return Ok(ZipArchive {
|
||||||
reader,
|
reader,
|
||||||
shared: shared.into(),
|
shared: shared.into(),
|
||||||
comment: footer.zip_file_comment.into(),
|
comment: Arc::from(mem::replace(&mut footer.zip_file_comment, Box::new([]))),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -625,17 +625,17 @@ impl<A: Read + Write + Seek> ZipWriter<A> {
|
||||||
///
|
///
|
||||||
/// This uses the given read configuration to initially read the archive.
|
/// This uses the given read configuration to initially read the archive.
|
||||||
pub fn new_append_with_config(config: Config, mut readwriter: A) -> ZipResult<ZipWriter<A>> {
|
pub fn new_append_with_config(config: Config, mut readwriter: A) -> ZipResult<ZipWriter<A>> {
|
||||||
let results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut readwriter)?;
|
let mut results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut readwriter)?;
|
||||||
for (footer, cde_start_pos) in results {
|
for (footer, cde_start_pos) in results.iter_mut() {
|
||||||
if let Ok(metadata) =
|
if let Ok(metadata) =
|
||||||
ZipArchive::get_metadata(config, &mut readwriter, &footer, cde_start_pos)
|
ZipArchive::get_metadata(config, &mut readwriter, &footer, *cde_start_pos)
|
||||||
{
|
{
|
||||||
return Ok(ZipWriter {
|
return Ok(ZipWriter {
|
||||||
inner: Storer(MaybeEncrypted::Unencrypted(readwriter)),
|
inner: Storer(MaybeEncrypted::Unencrypted(readwriter)),
|
||||||
files: metadata.files,
|
files: metadata.files,
|
||||||
stats: Default::default(),
|
stats: Default::default(),
|
||||||
writing_to_file: false,
|
writing_to_file: false,
|
||||||
comment: footer.zip_file_comment,
|
comment: mem::replace(&mut footer.zip_file_comment, Box::new([])),
|
||||||
writing_raw: true, // avoid recomputing the last file's header
|
writing_raw: true, // avoid recomputing the last file's header
|
||||||
flush_on_finish_file: false,
|
flush_on_finish_file: false,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue