Skip to content

Support (de-)serializing flattened unit struct#2802

Merged
dtolnay merged 1 commit into
serde-rs:masterfrom
jonhoo:flatten-unit-struct
Aug 15, 2024
Merged

Support (de-)serializing flattened unit struct#2802
dtolnay merged 1 commit into
serde-rs:masterfrom
jonhoo:flatten-unit-struct

Conversation

@jonhoo

@jonhoo jonhoo commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

Fixes #2801.

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

Copy link
Copy Markdown
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

@dtolnay dtolnay left a comment

Copy link
Copy Markdown
Member

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
@Mingun

Mingun commented Aug 15, 2024

Copy link
Copy Markdown
Contributor

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

jonhoo commented Aug 15, 2024

Copy link
Copy Markdown
Contributor Author

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