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

Adding a custom attribute to a type generated via strum_discriminants #375

Open
alex35mil opened this issue Sep 7, 2024 · 1 comment
Open

Comments

@alex35mil
Copy link

I need to add a custom attribute to a type generated via strum_discriminants:

#[derive(EnumDiscriminants)]
#[strum_discriminants(
    name(MyEnumD),
    derive(CustomDerive),
    CustomAttr = "value" // <- it doesn't compile
)]
pub enum MyEnum { ... }

The result should be:

#[derive(CustomDerive)]
#[CustomAttr = "value"]
pub enum MyEnumD { ... }

How to do that?

@tekacs
Copy link

tekacs commented Oct 5, 2024

This would be super helpful to add #[wasm_bindgen] to the Discriminants variant of an enum!

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

2 participants