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

Create two new derives: DeserializeFromStr and SerializeDisplay #86

Closed
jonasbb opened this issue Feb 21, 2020 · 0 comments · Fixed by #156
Closed

Create two new derives: DeserializeFromStr and SerializeDisplay #86

jonasbb opened this issue Feb 21, 2020 · 0 comments · Fixed by #156
Labels
enhancement New feature or request

Comments

@jonasbb
Copy link
Owner

jonasbb commented Feb 21, 2020

They would derive Deserialize and Serialize but using the Display/FromStr traits for implementation.
This would be a nicer way to configure the de/serialization where the struct is defined, without needing a wrapper type and without specifying this per field.

This proposal was also made here serde-rs/serde#553 (comment) and here serde-rs/serde#908

bors bot added a commit that referenced this issue Aug 16, 2020
156: Add derive macros to implement De/Serialize based on Display and FromStr r=jonasbb a=jonasbb


The crate already supports using Display and FromStr for de/serializing,
but only using the with-attribute and the serde_as system. Implementing
De/Serialize still required manual code.
This derive closes that gap.

Fixes #86
Closes serde-rs/serde#908

Co-authored-by: Jonas Bushart <jonas@bushart.org>
@bors bors bot closed this as completed in 42cd582 Aug 16, 2020
@bors bors bot closed this as completed in #156 Aug 16, 2020
@jonasbb jonasbb added the enhancement New feature or request label Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant