Skip to content

Allow enum from primitive creation to be used in a const context #159

@tetofonta

Description

@tetofonta

Because FromPrimitive is a trait, the function implementing this operation cannot be declared as const as per the current rust definitions.
This implies that using from_primitive(value) inside a const is impossible.

A const implementation can be added in a direct impl during derivation to allow for this behaviour.

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