Repository navigation
feat: add index_for_name_raw - #1210
Conversation
There was a problem hiding this comment.
This PR adds index_for_name_raw(&self, name: &[u8]) -> Option<usize> to ZipArchive, providing a direct O(1) raw-byte lookup without the CP437 fallback of index_for_name. The implementation is correct — it delegates directly to IndexMap::get_index_of. The doc-link fix in src/result.rs (correcting ExtractOptions::size_limit → ExtractOptions::with_size_limit) is also correct.
One issue found: a typo ("considiser") in the new doc comment on index_for_name. A one-click fix has been suggested.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
|
Should fix #1208 @Goldziher ping - you might be interested by this change |
|
The new API matches the request in #1208, and its semantics check out against the CP437 fixture from #1080: Before merge, consider:
|
|
nice |
|
@ouyangjiahong26 Thanks for your review; I made the requested changes. |
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com> Signed-off-by: n4n5 <git@n4n5.dev>
Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com>
|
@cycle-five Could you please take a look at this fuzz failure? https://github.com/zip-rs/zip2/actions/runs/40805120389/artifacts/12869415245 |
|
Reproduced with Root cause is in the harness: Fix: look through |
zip 9.2.0 (zip-rs/zip2#1210) gave `index_for_name` a fallback that matches an entry by its decoded name, so `by_name("å.bin")` now finds the CP437-named fixture. The test asserted that the lookup still failed, which pinned an upstream bug rather than our behaviour. Keep the checks that guard cat198x: `resolve_zip_entry_index` finds the entry and extraction by decoded name returns its bytes. The CP437 name identity test still passes unchanged on zip 9.2.2.
Fixes #1208.
Need help on this PR? Tag
@codesmith-botwith what you need.