Skip to content

unreadable_literal for floating-point numbers #4176

Closed
@kornelski

Description

@kornelski

unreadable_literal triggers for floating-point numbers such as

  |
5 |     0.095332, 0.118095, 0.095332,
  |                         ^^^^^^^^ help: consider: `0.095_332`

To me this is weird, because I consider _ in numbers as an equivalent of a thousands separator, and I've never seen thousands separators used in the fractional part of a decimal fraction.

In integers, the thousands separators matter, because you can't see magnitude of the number without counting digits. But in the fractional part, the length doesn't matter: the most significant digits are always in the same place, easy to find.

I suggest not linting the fractional part, as it's weird and unnecessary.


clippy 0.0.212 (265318d 2019-05-17)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsC-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesL-styleLint: Belongs in the style lint groupgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions