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 macro to derive better deserialization for untagged enums #1955

Merged
merged 8 commits into from
Feb 8, 2024

Conversation

DaughterOfMars
Copy link

Description of change

This deserialization is better than the derived serde version because it will not attempt every single variant, and additionally it will return the correct inner error if something goes wrong.

Links to any relevant issues

Closes #1950

@DaughterOfMars DaughterOfMars linked an issue Feb 6, 2024 that may be closed by this pull request
Thoralf-M
Thoralf-M previously approved these changes Feb 6, 2024
Thoralf-M
Thoralf-M previously approved these changes Feb 6, 2024
Copy link
Member

@thibault-martinez thibault-martinez left a comment

Choose a reason for hiding this comment

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

What about Payload?

@thibault-martinez thibault-martinez merged commit 4d7c9d6 into 2.0 Feb 8, 2024
37 checks passed
@thibault-martinez thibault-martinez deleted the feat/untagged-enum-deser branch February 8, 2024 08:31
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.

Serde better error than unmatched enum
3 participants