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

Support (de-)serializing flattened unit struct #2802

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Aug 15, 2024

Fixes #2801.

Comment on lines +1818 to +1819
#[test]
fn test_flatten_unit_struct() {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great if new flatten tests were added to the flatten module in the end of this file. Just my opinion

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!

I would accept a follow-up PR to move the flatten tests (including the existing ones adjacent to the one being added here).

@dtolnay dtolnay merged commit bfbedac into serde-rs:master Aug 15, 2024
15 checks passed
@Mingun
Copy link
Contributor

Mingun commented Aug 15, 2024

Thanks!

I would accept a follow-up PR to move the flatten tests (including the existing ones adjacent to the one being added here).

@dtolnay , great to hear that. What about moving other connected tests to made them located near to each other? #2788 does that for internally tagged enum tests and I working on similar PR for adjacently tagged enum tests.

@jonhoo jonhoo mentioned this pull request Aug 15, 2024
@jonhoo
Copy link
Contributor Author

jonhoo commented Aug 15, 2024

Sure thing!
#2803

I also tried to trim the names down to avoid as much stuttering now that they're under the mod flatten.

@jonhoo jonhoo deleted the flatten-unit-struct branch August 15, 2024 21:12
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.

Flattening a unit struct should work like flattening unit itself
3 participants