Skip to content

Guide: Enums chapter contains unexplained match keyword #18169

@lgrahl

Description

@lgrahl

See: https://github.com/rust-lang/rust/blob/master/src/doc/guide.md#enums

The match keyword hasn't been introduced until that point but it's used in the code example which is confusing.

I believe an if/else solution would be more explanatory, especially because the reader probably wants to see how to unpack the Value variant of enum OptionalInt. The same enum could then be used with the match keyword in the beginning of the next chapter (Match).

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