Skip to content

How to add per-variant attribute? #5

@VoilaNeighbor

Description

@VoilaNeighbor

I want to derive Default for my custom enum. To do this, I'd like to write this:

#[derive(EnumKind)]
#[enum_kind(PainterKind, derive(Default))]
pub enum Painter {
	#[default]
	LinePainter,
	CirclePainter,
}

But that #[default] attribute is not on PainterKind, but on Painter. Can we add support for such derives?

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