Skip to content

tutorial eschews destructuring-let (favoring match) too much #11569

Closed

Description

The Rust tutorial mentions that you can use let for destructuring patterns, but only in passing.

In particular, the sections that cover struct and tuples (and struct tuples) almost always use match rather than let to destructure their inputs, despite the fact that the patterns in these cases are irrefutable patterns.

I can understand wanting to minimize the number of concepts that are introduced, but let destructuring is so much more lightweight than match, we should try to point it out (a second time) in the struct/tuples section, perhaps immediately after the first instance of a use of match to destructure a struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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