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

Make Event::Unknown wrap UnknownEvent again #2612

Merged
merged 1 commit into from Nov 23, 2023

Conversation

mkrasnitski
Copy link
Collaborator

Marking Event::Unknown with #[serde(untagged)] allows it to wrap an UnknownEvent, which lets users keep data about unsupported events if they want to debug the issue or report it upstream. This doesn't affect performance, as the generated serde code is nearly identical. Deserialization operates as normal, only now in case of failure, serde will attempt to deserialize into Event::Unknown before giving up and returning an error.

@github-actions github-actions bot added model Related to the `model` module. client Related to the `client` module. labels Nov 22, 2023
@arqunis arqunis added enhancement An improvement to Serenity. breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users labels Nov 23, 2023
@arqunis arqunis merged commit 38a1cc9 into serenity-rs:current Nov 23, 2023
21 checks passed
@mkrasnitski mkrasnitski deleted the unknown-event branch November 24, 2023 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users client Related to the `client` module. enhancement An improvement to Serenity. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants