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

Feature request: allow a user supplied function to deserialize to the repr. #28

Open
eparmstrong opened this issue Mar 9, 2024 · 0 comments

Comments

@eparmstrong
Copy link

I'm dealing with files where the enums were sometimes serialized to floats instead of ints. I all ready have a function that I use with #[serde(deserialize_with = "path")] and would like to reuse it with Deserialize_repr. Maybe calling the attribute "deserialize_repr_with"?

The macro would then swap out
match <#repr as serde::Deserialize>::deserialize(deserializer)? {
with a call to the "deserialize_repr_with" function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant