Skip to content

Cover the short form match arm syntax Point { x, y } in addition to Point { x: x, y: y } #25779

Closed
@nliberg

Description

@nliberg

The patterns.md page doesn't explain that it's possible to match compound data in this way:
match origin { Point { x, y, .. } => ()
Currently only this form is covered:
match origin { Point { x: x, y: y, .. } => ()

The latter form results in compiler warnings (warning: the y: in this pattern is redundant and can be removed). I'm not sure whether it should be avoided for that reason.

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