Skip to content

Make unreadable_literal useful even when we use numbers with two decimals #13663

Open

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions