Skip to content

Allow marking groups of variants with a subenum instead of individually #44

@aaron-bentley-imax

Description

@aaron-bentley-imax

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,    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions