rust-lang / rust-lang/rust-clippy
lint `get` vs `index` dissonance
Open
Nobody has claimed this yet.
A-lint
E-hard
L-correctness
L-style
T-middle
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
for custom types we aren't sure that .get().unwrap() and [] are actually equivalent. They probably should be, so let's lint them.
Idea by @devonhollowood in https://github.com/Manishearth/rust-clippy/pull/1312#issuecomment-257664178
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 reviewing the referenced pull request #1312 discussion and the existing Clippy lint and test conventions. Clarify when custom-type .get().unwrap() and [] are equivalent, then define the lint behavior and tests that demonstrate the intended warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100