Repository navigation
fix(read): keep ZipIterable::len at the central directory entry count - #1221
Merged
Pr0methean merged 2 commits intoOct 30, 2026
Merged
Conversation
ZipIterable::len returned the number of entries left in the current pass, so it fell to 0 after iterating with files() even though the archive still had every entry. Return the declared entry count, as documented.
Pr0methean
approved these changes
Oct 30, 2026
Pr0methean
enabled auto-merge
October 30, 2026 16:05
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ZipIterable::len()returnedfiles.remaining, which counts down during a pass, so oncearchive.files()had been iterated,archive.len()reported 0 (or the number of entries not yet visited). Its doc says "Number of entries in the central directory". It now returns the central directory's entry count, the same valueZipIterableFilesstarts from and resets to.ZipIterableFiles::len()still reports what is left in the pass.Evidence
archive_len_is_unchanged_by_iterationtest fails on master:left: 1, right: 2.cargo test --test iterable_zip: 15 passed.Tests pass with default features,
--all-featuresand--no-default-featureson stable (rustc 1.93.1, Linux).cargo fmt --check --allis clean, andcargo clippy --all-targetsis clean with default and all features.Risk
Only
ZipIterable::len()andis_empty()change, and only after a pass has started.ZipIterableis not in a release yet.Unverified
MSRV and nightly builds, and Windows and macOS runs: left to CI.
cargo clippy --all-targets --no-default-featuresfails on master atsrc/extra_fields/extra_field.rs:369, which this PR doesn't touch.The PR title must conform to Conventional Commits and start with one of the types specified by the Angular convention.
Need help on this PR? Tag
@codesmith-botwith what you need.