Skip to content

unseparated_literal_suffix is very opinion oriented 0u8 versus 0_u8 #7658

@Stargateur

Description

@Stargateur

I just found unseparated_literal_suffix with rust-bakery/nom#1387 and I believe this have never been talk about:

  • This has been advice by unnecessary_cast and so I have a problem, 0 as u8 is very clear, clippy lint to just typed the 0 make sense to me, but then advice to add an _ to make it more clear ? when the original code is very clear ?
  • 0u8 is used in a LOT in rust literature without any problem I don't think it's more unclear than 0_u8
  • 0_u8 is longer to write
  • rustfmt doesn't fmt 0u8 to 0_u8
  • there is no talk about this
  • never see 0_u8 anywhere before

Thus I don't understand the lint (and the consequence to other lint) come a little from nowhere in my opinion.

Metadata

Metadata

Assignees

Labels

A-categoryArea: Categorization of lintsgood 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