Skip to content

Option to keep/generate "closed form" enum #25

@fu5ha

Description

@fu5ha

In implementing #24 and using it in our code based, the TryFromKnownRepr is useful but only moderately, since you still can't get an exhaustive match on just the known variants afterwards. It would be nice to somehow expose the original closed form of the enum as well, either as just OriginalIdentClosed or perhaps some trait

trait OpenEnum {
    type Closed;
}

then you can OriginalIdent::Closed?

And provide infallible From<Closed> for Open and fallible TryFrom<Closed> for Open, as replacement for TryFromKnownRepr.

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