refactor: move code to distinct file (datetime, FixedSizeBlock)#733
refactor: move code to distinct file (datetime, FixedSizeBlock)#733Its-Just-Nans merged 28 commits intomasterfrom
Conversation
Summary of ChangesHello, 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 primarily focuses on refactoring the codebase to improve organization and maintainability. It involves moving the Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
This refactoring successfully reorganizes code by moving DateTime to src/datetime.rs and ZIP block structures to src/spec.rs. The changes relocate code without modifying functionality, and the removal of the unsupported_zip_error helper in favor of direct Err(ZipError::UnsupportedArchive(...)) calls is correctly implemented. No blocking defects 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
The pull request successfully refactors the DateTime struct and fixed-size block definitions into their own dedicated files, src/datetime.rs and src/spec.rs respectively. This improves modularity and organization within the codebase. The inlining of unsupported_zip_error in src/read.rs also simplifies error handling in those specific locations.
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipCentralEntryBlock { |
Check failure
Code scanning / clippy
no function or associated item named `parse` found for struct `spec::ZipCentralEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no method named `magic` found for struct `spec::ZipLocalEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no associated item named `WRONG_MAGIC_ERROR` found for struct `spec::ZipLocalEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no method named `from_le` found for struct `spec::ZipLocalEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no method named `magic` found for struct `spec::ZipLocalEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no associated item named `WRONG_MAGIC_ERROR` found for struct `spec::ZipLocalEntryBlock` in the current scope
|
|
||
| #[derive(Copy, Clone, Debug)] | ||
| #[repr(packed, C)] | ||
| pub(crate) struct ZipLocalEntryBlock { |
Check failure
Code scanning / clippy
no method named `from_le` found for struct `spec::ZipLocalEntryBlock` in the current scope
DateTimeto a new datetime.rsFixedSizeBlockinside specunsupported_zip_error