refactor: simplify extra field parsing#764
Conversation
Its-Just-Nans
commented
Apr 5, 2026
- The PR title must conform to Conventional Commits
There was a problem hiding this comment.
This refactoring successfully simplifies extra field parsing by moving parsing logic into the respective struct implementations. The changes improve code organization and maintainability while preserving existing behavior. No blocking issues found.
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 the parsing of ZIP extra fields by moving the logic for AexEncryption and Zip64ExtendedInformation into dedicated parse methods. It also implements TryFrom for AesVendorVersion and AesMode to simplify conversion logic. Feedback includes fixing compilation errors caused by missing size_of imports in zip64_extended_information.rs and optimizing byte skipping to avoid unnecessary heap allocations.
| let Some(leftover_len) = (len as usize).checked_sub(consumed_len) else { | ||
| return Err(invalid!("ZIP64 extra-data field is the wrong length")); | ||
| }; | ||
| if let Err(e) = reader.read_exact(&mut vec![0u8; leftover_len]) { |
There was a problem hiding this comment.
Pr0methean
left a comment
There was a problem hiding this comment.
Looks great! Could use one minor change, which I'll commit.
Signed-off-by: Chris Hennick <[email protected]>