You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(MyDeriveMacro)]#[my_derive_macro(/* struct attributes */)]structFoo{#[my_derive_macro(/* field attributes */)]bar: syn::LitIdent,}
The set of valid attributes on the struct vs on a field is different, but the name my_derive_macro should stay the same. How to achieve this with bae? Is this the best way?:
mod struct_attrs {#[derive(bae::FromAttributes)]pubstructMyDeriveMacro{/* struct attributes */}}use struct_attrs::MyDeriveMacroasStructAttrs;mod field_attrs {#[derive(bae::FromAttributes)]pubstructMyDeriveMacro{/* field attributes */}}use field_attrs::MyDeriveMacroasFieldAttrs;
A #[bae(name = "...")]/#[bae(rename = "...")]/#[bae(prefix = "...")] attribute on FromAttributes-derived structs could solve this nicely:
Use case:
The set of valid attributes on the struct vs on a field is different, but the name
my_derive_macro
should stay the same. How to achieve this with bae? Is this the best way?:A
#[bae(name = "...")]
/#[bae(rename = "...")]
/#[bae(prefix = "...")]
attribute on FromAttributes-derived structs could solve this nicely:Would such a PR be accepted?
The text was updated successfully, but these errors were encountered: