rust-lang / rust-lang/rust-clippy
match_ref_pats: don't suggest if there's only a single & to be removed
Open
Nobody has claimed this yet.
S-needs-discussion
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
The lint will suggest to change
match self {
&AlignedTestName(_, p) => p,
_ => PadNone,
}
to
match *self {
AlignedTestName(_, p) => p,
_ => PadNone,
}
IMO that's not much of an improvement if there is only a single pattern that is changed.
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.
Research direction
Start by locating the match_ref_pats lint in rust-clippy and reproduce the issue with the match example shown here. The work is done when the lint no longer suggests removing the single remaining reference pattern, while its existing behavior for multiple removable patterns remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100