Skip to content

Commit

Permalink
Update src/read.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
Signed-off-by: Mike Krüger <mikkrg@microsoft.com>
  • Loading branch information
mkrueger and Pr0methean authored May 20, 2024
1 parent 7d99b89 commit 52263ba
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,25 +198,7 @@ impl<'a> ZipFileReader<'a> {
ZipFileReader::Raw(r) => r,
ZipFileReader::Stored(r) => r.into_inner().into_inner(),
#[cfg(feature = "legacy-zip")]
ZipFileReader::Shrink(r) => {
// Lzma reader owns its buffer rather than mutably borrowing it, so we have to drop
// it separately
if let Ok(mut remaining) = r.into_inner().finish() {
let _ = copy(&mut remaining, &mut sink());
}
return;
}
#[cfg(feature = "legacy-zip")]
ZipFileReader::Reduce(r) => {
// Lzma reader owns its buffer rather than mutably borrowing it, so we have to drop
// it separately
if let Ok(mut remaining) = r.into_inner().finish() {
let _ = copy(&mut remaining, &mut sink());
}
return;
}
#[cfg(feature = "legacy-zip")]
ZipFileReader::Implode(r) => {
ZipFileReader::Shrink(r) | ZipFileReader::Reduce(r) | ZipFileReader::Implode(r) => {
// Lzma reader owns its buffer rather than mutably borrowing it, so we have to drop
// it separately
if let Ok(mut remaining) = r.into_inner().finish() {
Expand Down

0 comments on commit 52263ba

Please sign in to comment.