refactor: change extra_data to extra_fields#833
Conversation
There was a problem hiding this comment.
This PR successfully refactors the extra field handling system by introducing a CustomExtraField type to replace the previous raw Vec<u8> approach. The changes improve type safety and code organization while maintaining backward compatibility. All modifications follow consistent patterns across the codebase, and the test suite has been appropriately updated to reflect the new API. No blocking issues identified.
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.
There was a problem hiding this comment.
Code Review
This pull request refactors ZIP extra field management by replacing raw byte buffers in ExtendedFileOptions with a structured CustomExtraField type, updating the writer and associated tests accordingly. Feedback highlights a bug in CustomExtraField::new_from_raw where the payload incorrectly includes size bytes, and identifies a redundant bounds check. Furthermore, an optimization was suggested to minimize memory allocations when collecting serialized extra fields.
Pr0methean
left a comment
There was a problem hiding this comment.
This is a partial review (covers all except src/write.rs).
Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Signed-off-by: n4n5 <git@n4n5.dev>
Co-authored-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Signed-off-by: n4n5 <git@n4n5.dev>
|
Thanks for the review. Note that this MR is only the PART 1 of the extra field review. |
|
CI is showing a bug in the latest nightly cargo +nightly miri test --target aarch64_be-unknown-linux-gnu --all --no-default-features zip64_with_leading_junkEDIT: see #843 |
Part 1 of the extra field rewrite