Skip to content

feat: refactor/support tuple structs and enums#14

Merged
bbaldino merged 10 commits into
masterfrom
refactor
Jun 4, 2025
Merged

feat: refactor/support tuple structs and enums#14
bbaldino merged 10 commits into
masterfrom
refactor

Conversation

@bbaldino
Copy link
Copy Markdown
Owner

@bbaldino bbaldino commented Jun 3, 2025

Lots here, including some major code reorganization. Main bulk of the changes are to support enums and tuple structs.

@bbaldino bbaldino requested a review from Copilot June 3, 2025 23:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase to support enums and tuple structs by reorganizing core implementations, improving the APIs used for reading and writing, and updating field handling to better support non-standard struct layouts. Key changes include:

  • Refactoring field-related functions to accept &syn::Member instead of &syn::Ident.
  • Updating module visibility and renaming receiver types in the derive implementations.
  • Cleaning up legacy code and reorganizing helper functions for improved maintainability.

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated no comments.

File Description
impl/src/model_types.rs Updated field parameter types and removed legacy assignment generation code to improve tuple struct support.
impl/src/lib.rs Exposed the syn_helpers module as pub(crate) and updated derive dispatch logic for receiver types.
impl/src/code_gen/* Reorganized generation logic into dedicated read and write modules and updated receiver types for enums and structs.
Notes.md Updated design notes documenting attribute precedence and reordering logic for ParselyRead.
Comments suppressed due to low confidence (3)

impl/src/model_types.rs:242

  • Changing the field parameter from &syn::Ident to &syn::Member improves support for tuple struct fields, but please ensure consistent usage and clear documentation across the codebase.
pub(crate) fn to_read_map_tokens(&self, field_name: &syn::Member, tokens: &mut TokenStream) {

impl/src/lib.rs:6

  • Exposing the 'syn_helpers' module as pub(crate) increases its visibility; please verify that this change aligns with the intended encapsulation boundaries of the project.
pub(crate) mod syn_helpers;

impl/src/model_types.rs:22

  • [nitpick] The removal of the custom assignment generation method from TypedFnArgList simplifies the type's interface; please confirm that any necessary specialized assignment logic is now handled appropriately in a different location.
// Removed assignment generation method

@bbaldino bbaldino merged commit 17a13cd into master Jun 4, 2025
1 check passed
@bbaldino bbaldino deleted the refactor branch June 4, 2025 01:29
@github-actions github-actions Bot mentioned this pull request Jun 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