-
Notifications
You must be signed in to change notification settings - Fork 744
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 #[serde(rename = "...")] on tuple struct / tuple variant member fields #1510
Comments
@dtolnay Would you accept a PR that implements this? |
I would prefer not to support this. I agree it's something that we could support, but I don't think the benefit will be big enough to justify adding logic to serde_derive. One thing I would gladly accept though is any simplifications to serde_derive, to make the implementation more straightforward or compile faster. |
That's unfortunate. So should this issue be closed then? Re. simplifications: Are you talking about the raw compile time of serde_derive, or about the compile time of the code it generates (or both)? I haven't previously done any compile time profiling, but I've heard Rust has pretty decent tooling for this, so I might give it a try. |
Both of those are good things! |
Here is some working code that I would love to be able to condense:
I tried like this, but got
Error("invalid type: map, expected a string")
on deserialization:This looks like something that could be supported to me. Or if it is deemed too niche + cryptic the additional
rename
should probably compile-error since it doesn't have any effect, right?The text was updated successfully, but these errors were encountered: