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

Eliminate some duplicated code #2446

Merged
merged 5 commits into from
May 10, 2023
Merged

Eliminate some duplicated code #2446

merged 5 commits into from
May 10, 2023

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented May 8, 2023

The first commit removes the one copy of the FlatMapAccess struct.

The third commit removes superfluous constructors of FlatMapAccess and FlatStructAccess. Since FlatInternallyTaggedAccess did without it, it seems to me that this is acceptable. Besides, I found that without constructors that used only in one place to construct a struct is is a little easier to understand the code.

The last two commits extracts repeated code into functions.

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!

@dtolnay dtolnay merged commit 9441a29 into serde-rs:master May 10, 2023
@Mingun Mingun deleted the dedup2 branch May 10, 2023 07:27
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.

3 participants