Skip to content

RUST-1243 Handle enum keys when deserializing a map from binary #348

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

Merged
merged 4 commits into from
Mar 28, 2022

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Mar 28, 2022

RUST-1243

Prior to this PR, all keys were treated as strings, so the deserialization would fail with "invalid type: string "Key", expected enum Enum". This bug doesn't occur when deserializing from the parsed Bson types because that one uses the main deserializer to parse the key (which knows how to handle enum values) rather than a specialized one.

Copy link
Contributor

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

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

great job hunting this down so quick!

@patrickfreed
Copy link
Contributor

Looks like lint needs to be fixed up but besides that LGTM holds (no need for another round of review from me)

@abr-egn abr-egn merged commit 69fa4e2 into mongodb:master Mar 28, 2022
abr-egn added a commit to abr-egn/bson-rust that referenced this pull request Mar 28, 2022
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.

3 participants