-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support deserializing enum values in internally/untagged enums
Specifically, this deserializes the "variant" as a `Content` and visits the value with `newtype_variant::<Content>`. There is no perfect solution here as the enum value could be a map, tuple, unit, etc. However, given that we're trying to deserialize arbitrary values, deserializing as a "newtype" actually makes a lot of sense: 1. Deserializers can opt-in to this fairly easily by implementing `EnumAccess::newtype_variant_seed`. 2. Types (implementing `Deserialize`) should "just work" as expected because maps, tuples, etc. are preserved.
- Loading branch information
Showing
1 changed file
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters