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

Simplify code for generation of struct deserializers #2444

Merged
merged 10 commits into from Jul 6, 2023

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented May 6, 2023

The first 7 commits of this PR eliminates various duplications from the code, making it more easely to understand, as I hope.

The last 3 commits makes more obvious which code is generated for different combinations of arguments. Because not all combinations are possible, after the changes impossible variants are not representable in the code.

serde_derive/src/de.rs Outdated Show resolved Hide resolved
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks! This is a great cleanup. And thanks Oli for the review.

#2444 looks good (modulo a comment). It is a pure refactoring in well-reviewable individual commits. I checked that it does not change behaviour. The main part that needs your review is the actual change (moving from multiple somewhat connected boolish or option arguments to a single enum that separates all the different cases into explicit variants)

@dtolnay dtolnay merged commit ed9a140 into serde-rs:master Jul 6, 2023
19 checks passed
@Mingun Mingun deleted the dedup branch July 7, 2023 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants