-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unreadable_literal is annoying for hex numbers #2842
Comments
Do you have some examples for this? IMO this lint suggests more readable Hex-literals (most of the time). |
For example in RustCrypto crates we selectively disable |
Yeah making walls of hex-literals more readable doesn't really make sense. But I would say this is an edge case, since you shouldn't have things like this spread around in your code, but only in a few special files. Disabling the lint in those files seems reasonable to me. This lint aims more on single literals in your Code, like const IM_A_FLAG: u16 = 0x00FF8000;
vs
const IM_A_READABLE_FLAG: u16 = 0x00FF_8000; IMO the second version is nicer. |
When having hex literals in code, conciseness is usually more important than readability, so the lint seems to be counter-productive in such cases.
The text was updated successfully, but these errors were encountered: