Skip to content

Add more tests for flatten enums to increase test coverage #2929

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented May 24, 2025

This PR adds more tests for enum flatten into the struct (each in their own commit):

  • Ensure, that serialization produces output that can be deserialized
  • Ensure, that any order of fields in the serialized form for
    struct Flatten {
      #[serde(flatten)]
      data: Enum,
      other_fields: ...,
    }
    can be deserialized
  • Ensure, that Enum::Unit can be deserialized when Enum is flatten like above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant