Skip to content

Commit

Permalink
chore: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jun 18, 2024
1 parent cb2d7ab commit 19118f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
pub fn with_config(config: Config, mut reader: R) -> ZipResult<ZipArchive<R>> {
let results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut reader)?;
for (footer, cde_start_pos) in results {
if let Ok(shared) = Self::get_metadata(config, &mut reader, &footer, cde_start_pos) {
let mut results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut reader)?;
for (footer, cde_start_pos) in results.iter_mut() {
if let Ok(shared) = Self::get_metadata(config, &mut reader, &footer, *cde_start_pos) {

Check failure on line 815 in src/read.rs

View workflow job for this annotation

GitHub Actions / style_and_docs (--no-default-features)

this expression creates a reference which is immediately dereferenced by the compiler

Check failure on line 815 in src/read.rs

View workflow job for this annotation

GitHub Actions / style_and_docs

this expression creates a reference which is immediately dereferenced by the compiler

Check failure on line 815 in src/read.rs

View workflow job for this annotation

GitHub Actions / style_and_docs (--all-features)

this expression creates a reference which is immediately dereferenced by the compiler
return Ok(ZipArchive {
reader,
shared: shared.into(),
comment: footer.zip_file_comment.into(),
comment: Arc::from(mem::replace(&mut footer.zip_file_comment, Box::new([]))),
});
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,17 +625,17 @@ impl<A: Read + Write + Seek> ZipWriter<A> {
///
/// 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>> {
let results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut readwriter)?;
for (footer, cde_start_pos) in results {
let mut results = spec::Zip32CentralDirectoryEnd::find_and_parse(&mut readwriter)?;
for (footer, cde_start_pos) in results.iter_mut() {
if let Ok(metadata) =
ZipArchive::get_metadata(config, &mut readwriter, &footer, cde_start_pos)
ZipArchive::get_metadata(config, &mut readwriter, &footer, *cde_start_pos)

Check failure on line 631 in src/write.rs

View workflow job for this annotation

GitHub Actions / style_and_docs (--no-default-features)

this expression creates a reference which is immediately dereferenced by the compiler

Check failure on line 631 in src/write.rs

View workflow job for this annotation

GitHub Actions / style_and_docs

this expression creates a reference which is immediately dereferenced by the compiler

Check failure on line 631 in src/write.rs

View workflow job for this annotation

GitHub Actions / style_and_docs (--all-features)

this expression creates a reference which is immediately dereferenced by the compiler
{
return Ok(ZipWriter {
inner: Storer(MaybeEncrypted::Unencrypted(readwriter)),
files: metadata.files,
stats: Default::default(),
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
flush_on_finish_file: false,
});
Expand Down

0 comments on commit 19118f4

Please sign in to comment.