Allow to deserialize struct variants of untagged and adjacently tagged enums from seq #2465
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The artificial limitation on use of
visit_seq
method was introduced in #1058 without any rationale. I suggest to remove it. The consequences are:visit_seq
methodvisit_seq
methodThis change has a sense, because you already can do the same by wrapping an ordinary struct into a Newtype variant, but I think, that change from
to
should not change the behavior because this situation can arise during refactoring and changing behavior can be surprising.
I didn't include tests in that PR, because correct test suite should cover all possible situations, and many of them have certain problems. I plan to include a full testsuite in my upcoming PR for fixing #2105.
Right now you can see what changed in the generated code by running the following commands:
test_suite/tests
folder and change its extension to.rs
...\serde\test_suite> cargo expand --all-features --test skip
Closes #2473, closes serde-rs/json#1049