rust-lang / rust-lang/rust-clippy
Split `suboptimal_flops` into smaller lints
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
suboptimal_flops is very useful. Most of its suggestions are wins both for readability and performance, however some significantly reduce readability in my opinion.
E.g.
a * 2.0 + 3.0
is a lot more readable than
a.mul_add(2.0, 3.0)
in particular for new developers that may not be familiar with mul_add.
We'd love to enable suboptimal_flops for our code-base, but there is definitely some friction where it makes suggestions that just makes the code less readable in code that doesn't need the absolute maximum performance.
I propose splitting suboptimal_flops into two smaller lint groups such that one group contains all lints that improve performance and readability, and the other contains those that improve performance, but may impact readability negatively.
Drawbacks
More lint types
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 reading the existing suboptimal_flops lint and its documented suggestions. Review the issue discussion to determine which suggestions belong in each new lint group, then verify that the groups can be configured independently and that the lint documentation and tests reflect the split.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100