rust-lang / rust-lang/rust-clippy
Unused subpattern
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.