Skip to content

Lint for not using field pattern shorthands where applicable. #17792

Closed
@eddyb

Description

@eddyb
match p {
    Point { x: x, y: ref y } => ...
}
// can be written as
match p {
    Point { x, ref y } => ...
}

Sadly, there is no obvious way to check for this.
Both forms use the same AST, and only the pattern has a Span at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions