rust-lang / rust-lang/rust-clippy

Unused subpattern

Open
#14,899 1 comment 0 reactions 1 assignee View on GitHub

@max-heller is already working on this.

Since Mar 8, 2026.

A-lint
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Description

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!(),
    }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.