Closed
Description
clippy 0.0.212 (69f99e7 2019-12-14)
The lint for #[warn(unnecessary_cast)]
acts strangely when integers are written in hex. Example:
let r = 0x1b as f32 / 255.0;
// ^^^^^^^^^^^ - unnecessary cast write integer literal as 29_f32
However, f32
is valid hex, so if I write 0x1b_f32
rust interprets the value as an integer. It does helpfully output the integer literal as a decimal number in the suggestion, but it isn't hex anymore which defeats the purpose.