Skip to content

Allow deriving ToEnum instead of just FromEnum #2

@FSMaxB

Description

@FSMaxB

I ran into a case where I had to do the conversion both ways, not just from foreign enum into my own, but also the other way round from my own enum into the foreign one.

enum_to_enum's FromEnum was a great help, because it reduces the boilerplate by half, but for the opposite direction, I still had to implement the From<MyEnum> for ForeignEnum myself.

Would it make sense to add a ToEnum derive as well?

Not sure how well this interacts with the effects though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions