Closed
Description
Clippy suggests I rewrite a hexadecimal value as decimal, but I wrote it in hex for a reason and want to keep it that way.
Minimal reproduction:
let a: f32 = 0xff as f32;
Result:
warning: casting integer literal to `f32` is unnecessary
--> src/main.rs:113:22
|
113 | let a: f32 = 0xff as f32;
| ^^^^^^^^^^^ help: try: `255_f32`
|
= note: `#[warn(clippy::unnecessary_cast)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
$ cargo clippy -V
clippy 0.0.212 (4ee1206 2020-02-01)
Metadata
Metadata
Assignees
Labels
No labels