Skip to content
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

False positive: zero_prefixed_literal: suggest to use x1 which is invalid and not detect it is an hexdecimal notation. #5215

Closed
otavio opened this issue Feb 22, 2020 · 1 comment

Comments

@otavio
Copy link

otavio commented Feb 22, 2020

warning: this is a decimal constant
   --> src/connection.rs:108:60
    |
108 |             DeviceType::ValueA => (0x0505, 0xa4a6, 0x81, 0x1),
    |                                                          ^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
    |
108 |             DeviceType::ValueA => (0x0505, 0xa4a6, 0x81, x1),
    |                                                          ^^
help: if you mean to use an octal constant, use `0o`
    |
108 |             DeviceType::ValueA => (0x0505, 0xa4a6, 0x81, 0ox1),
    |                                                          ^^^^
@flip1995
Copy link
Member

Duplicate of #5169

Fixed in #5170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants