Skip to content

Unused subpattern #14899

Open
Open
@A4-Tacks

Description

@A4-Tacks

What it does

  • Simplified code

Advantage

  • Clean

Drawbacks

Possible change of Drop point

Example

fn main() {
    let (a, b) = (2, 3);
    match (a, b) {
        (_, 2) => todo!(),
        (_, 3) => todo!(),
        _ => todo!(),
    }
}

Could be written as:

fn main() {
    let (a, b) = (2, 3);
    match b {
        2 => todo!(),
        3 => todo!(),
        _ => todo!(),
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions