rust-lang / rust-lang/rust-clippy
Make unreadable_literal useful even when we use numbers with two decimals
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
What it does
In a project there are a lot of numbers like this: 12345678900 which means 123456789.00, maybe because we are using rust_decimal::Decimal::new(12345678900, 2).
unreadable_literal makes me write instead: 12_345_678_900 which as you can see is misleading during the code review.
Why not also suggest 1_23_45_67_89_00, maybe changing the settings?
Advantage
No response
Drawbacks
No response
Example
<code>
Could be written as:
<code>
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 unreadable_literal lint implementation and reviewing how its current grouping behavior is checked. Clarify the desired configurable grouping for values with two decimal places, then add coverage showing the intended suggestions and confirming existing cases remain correct.
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
- Needs clarification
- Newbie friendliness
- 35/100