Skip to content

Derive "Option pattern" #6

@CryZe

Description

@CryZe

I don't have a good name for this but a lot of enums have methods for each variant that return an Option<...> for that variant's data. Both Result and Option in the standard library do that for example. Could easily be derivable. Also there's fn is_<variant>(&self) -> bool for all of these variants too.

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