Skip to content

Derive Enum Kind #5

@CryZe

Description

@CryZe

Often it makes sense to have a separate enum that contains the same variants, but without their associated data. This is often useful for error types, but also useful for a lot of other situations. So the derive would create a second type with the exact same variations named <EnumName>Kind deriving PartialEq, Eq, Debug and potentially other traits. And the original enum would get a method fn kind(&self) -> <EnumName>Kind that returns that kind.

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