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

Parse #[ts(tag = "...")] on structs #244

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Parse #[ts(tag = "...")] on structs #244

merged 2 commits into from
Feb 29, 2024

Conversation

escritorio-gustavo
Copy link
Contributor

This PR adds a #[ts(...)] equivalent to #[serde(tag = "...")] on structs

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.

Ohh, right, we've already got tag on StructAttr since we use that for enums under the hood. Very elegant, love it!

@escritorio-gustavo escritorio-gustavo merged commit 63d2d46 into main Feb 29, 2024
10 checks passed
@escritorio-gustavo escritorio-gustavo deleted the tag-struct branch February 29, 2024 18:12
@escritorio-gustavo
Copy link
Contributor Author

Ohh, right, we've already got tag on StructAttr since we use that for enums under the hood

I don't think that's why we already had tag on StructAttr, since EnumAttr has its own tag to handle that. Instead we did already support the serde feature of adding a tag to a struct, but it required serde-compat and #[serde(...)]

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.

None yet

2 participants