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

Allow builder_struct_attr to set attributes before #[derive(...)] #323

Open
mmarkmos opened this issue Jun 23, 2024 · 1 comment
Open

Allow builder_struct_attr to set attributes before #[derive(...)] #323

mmarkmos opened this issue Jun 23, 2024 · 1 comment

Comments

@mmarkmos
Copy link

I use this lib to have "duplicates" of my structs where each field is Optional for serde. I want use skip_serializing_none macro so that I don't have to repeat #[builder_field_attr(serde(skip_serializing_if = "Option::is_none"))] on every field. But this attribute has to be set before the derive to work.

@TedDriggs
Copy link
Collaborator

According to this comment, those attrs can't come before the derives without causing a compiler warning. It sounds like this would require another tweak to #[builder_struct_attr(...)] to work; probably another new attribute name.

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

No branches or pull requests

2 participants