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

Fix empty struct tagged enum variant #371

Merged
merged 4 commits into from
Nov 25, 2024

Conversation

gustavo-shigueo
Copy link
Collaborator

@gustavo-shigueo gustavo-shigueo commented Nov 25, 2024

Goal

Fix incorrect behavior of the tag attribute for structs without any fields declared with braces (struct Foo {}). These structs, when used with the tag attribute should compile and produce a type containing a single field representing the struct's tag.

This bug was revealed by a regression caused #344, which refactored internally tagged enums to take advantage of struct tagging instead of manually reimplementing the behavior.
Closes #369

Changes

How did you go about solving the problem?

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

@gustavo-shigueo gustavo-shigueo added the bug Something isn't working label Nov 25, 2024
@gustavo-shigueo gustavo-shigueo merged commit 6438296 into main Nov 25, 2024
18 checks passed
@gustavo-shigueo gustavo-shigueo deleted the fix_empty_struct_enum_variant branch November 25, 2024 16:24
@gustavo-shigueo
Copy link
Collaborator Author

Hey @NyxCode, since the release of v10, we have fixed a couple of bugs related to serde_json null/boolean and now this one. Support for tokio types has also been added. I think it might be a good idea to release a version 10.1.0 to include these bug fixes

@NyxCode
Copy link
Collaborator

NyxCode commented Dec 1, 2024

Good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Regression Empty Struct Enum Variants with serde tag attribute
2 participants