Skip to content

What if the mapping is non-surjective? #3

@iynehz

Description

@iynehz

For example I want to map Foo to Bar, but in Bar I have a C that cannot possibly be mapped from A. But ideally “impl From for Bar" should work, as every enum item in Foo can be mapped to Bar. Does this crate support this case?

enum Foo {
    A, 
    B,
}

enum Bar {
    A, 
    B,
    C,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions