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 marking groups of variants with a subenum instead of individually #44

Open
abentley-ssimwave opened this issue Dec 10, 2024 · 0 comments

Comments

@abentley-ssimwave
Copy link

When you have a lot of variants, it can be a lot of visual noise to have an attribute macro on each.

So instead of

#[subenum(Foo, Bar)]
enum {
    #[subenum(Foo)]
    variant_1,

    #[subenum(Foo)]
    variant_2,

    #[subenum(Foo)]
    variant_3,

    #[subenum(Bar)]
    variant_4,    
}

(but with Foo going a lot higher than 3), it would be nice to do

#[subenum(Foo, Bar)]
enum {
    #[subenum_variants_start(Foo)]
    variant_1,

    variant_2,

    #[subenum_variants_end(Foo)]
    variant_3,

    #[subenum(Bar)]
    variant_4,    
}
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