-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages
Description
Description
I am sorry if there is a lint/option for this already. I couldn't find any though.
Below is code from DNGlab
, a CLI to convert camera RAW files to DNG format.
Hex literals are used with intent in the codebase to match vendor documentation about hardware, e.g. lenses:
let lensdata = match version {
0x100 => ...,
0x101 => ...,
0x201 | 0x202 | 0x203 => { ... }
[...]
clippy --fix
turns this into this:
``` rust
let lensdata = match version {
0x100 => ...,
0x101 => ...,
513..=515 => { ... }
[...]
It would be great if the hex literals could be preserved here, i.e. clippy
would instead suggest/generate:
let lensdata = match version {
0x100 => ...,
0x101 => ...,
0x201..=0x203 => { ... },
[...]
Version
rustc 1.74.0-nightly (58e967a9c 2023-09-03)
binary: rustc
commit-hash: 58e967a9cc3bd39122e8cb728e8cec6e3a4eeef2
commit-date: 2023-09-03
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages