Skip to content

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

Closed
@otavio

Description

@otavio
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),
    |                                                          ^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions