Skip to content

Conversation

@Its-Just-Nans
Copy link
Contributor

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Its-Just-Nans, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug where ZIP64 data descriptors were not being correctly written for large files, even when the large_file option was enabled. The changes refactor the data descriptor writing mechanism, centralizing the logic within the ZipFileData structure to ensure that the appropriate ZIP64 descriptor is used when a file exceeds standard ZIP size limits. This improves the reliability of handling large files within the zip archive creation process.

Highlights

  • Refactored Data Descriptor Writing: The logic for writing data descriptors (standard vs. ZIP64) has been moved from a global function into a new method write_data_descriptor within the ZipFileData struct, centralizing this behavior.
  • Correct ZIP64 Descriptor Usage: The system now explicitly checks the large_file flag on ZipFileData to determine whether to write a standard data descriptor or a ZIP64 data descriptor, ensuring proper handling for files exceeding standard ZIP size limits.
  • Test Case Enhancement: An existing test case in src/spec.rs was updated to correctly initialize SimpleFileOptions when testing large_file functionality, making the test more robust and accurate.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes an issue with writing zip64 data descriptors for large files. The logic for writing data descriptors has been refactored into a method on ZipFileData, which correctly chooses between a standard and a zip64 data descriptor based on the large_file flag. This improves encapsulation and correctness. Additionally, some code blocks have been simplified by replacing immediately-invoked closures with standard blocks, which improves readability.

My review found one critical issue: a leftover debugging println! statement that must be removed.

@Pr0methean Pr0methean changed the title fix: write z64 desc if large_file fix: Write ZIP64 data descriptors for large files Oct 30, 2025
@Pr0methean Pr0methean changed the title fix: Write ZIP64 data descriptors for large files fix: Write ZIP64 data descriptors when large_file option is true Oct 30, 2025
@Pr0methean Pr0methean enabled auto-merge October 30, 2025 06:54
@Pr0methean
Copy link
Member

Looks good. Thanks for fixing this!

@Pr0methean Pr0methean added this pull request to the merge queue Oct 30, 2025
Merged via the queue into zip-rs:master with commit ec634aa Oct 30, 2025
66 checks passed
Its-Just-Nans added a commit to Its-Just-Nans/zip2 that referenced this pull request Oct 31, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 20, 2025
…ata descriptor when necessary (#468)

* better write_data_descriptor #467

* useless

* Update src/types.rs

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: n4n5 <git@n4n5.dev>

* rm underscore

* cargo fmt

---------

Signed-off-by: n4n5 <git@n4n5.dev>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This was referenced Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants