Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for #[serde(rename_all_fields = "...")] attribute #225

Merged
merged 10 commits into from
Feb 8, 2024

Conversation

escritorio-gustavo
Copy link
Contributor

Adds support for the #[serde(rename_all_fields = "...")] enum attribute, as well as a #[ts(rename_all_fields = "...")] equivalent.
This attribute behaves the same as adding #[ts(rename_all = "...")] to each struct variant of an enum, but not on the enum itself, so the variant names will not be affected, for that #[ts(rename_all = "...")] still must be used on the enum

@escritorio-gustavo escritorio-gustavo changed the title Add support for #[serde(rename_all_fields = "...")] attribute Add support for #[serde(rename_all_fields = "...")] attribute Feb 5, 2024
Copy link
Collaborator

@NyxCode NyxCode left a comment

Choose a reason for hiding this comment

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

Besides that small nit-pick, nice and elegant change! Great work!

macros/src/types/enum.rs Outdated Show resolved Hide resolved
@escritorio-gustavo escritorio-gustavo merged commit dd32308 into main Feb 8, 2024
8 checks passed
@escritorio-gustavo escritorio-gustavo deleted the support_rename_all_fields branch February 8, 2024 20:12
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