feat(codegen): Infer Default and Deserialize bounds correctly #285
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.
This PR addresses the remaining part of #197 (following up on my previous PRs #260 and #265) by inferring a
T: Default
bound for fields that (1) have#[serde(default)]
, or (2) have#[serde(skip_deserializing)]
and not#[serde(default=...)]
. I factored out the generics-building code from #260 to share it between ser and de.This PR also makes progress toward #259, although I have not attempted to resolve the
MapVisitor::missing_field
problem mentioned in that issue.