Skip to content

Fix (de)serialization of new types where the internal type is skipped#1622

Merged
dtolnay merged 2 commits intoserde-rs:masterfrom
Xaeroxe:fix-new-types
Sep 8, 2019
Merged

Fix (de)serialization of new types where the internal type is skipped#1622
dtolnay merged 2 commits intoserde-rs:masterfrom
Xaeroxe:fix-new-types

Conversation

@Xaeroxe
Copy link
Copy Markdown
Contributor

@Xaeroxe Xaeroxe commented Sep 7, 2019

Fixes #1396

The derive logic for newtype variants was not considering the possibility that the one value in the newtype might be skipped. This pull request fixes that. Additionally it adds some test cases that failed before, and now succeed.

@Xaeroxe
Copy link
Copy Markdown
Contributor Author

Xaeroxe commented Sep 7, 2019

This isn't quite ready for merge yet. The bug fix still needs to be applied to the functions for other forms of tagging in enums. I'll work on that in the morning.

@Xaeroxe
Copy link
Copy Markdown
Contributor Author

Xaeroxe commented Sep 7, 2019

Ok, this has been applied to other enum representations and is ready for review.

Copy link
Copy Markdown
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 111c18d into serde-rs:master Sep 8, 2019
@Xaeroxe Xaeroxe deleted the fix-new-types branch September 8, 2019 05:59
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.

#[serde(skip)] in tuple enum variants silently ignored

2 participants