Files
rust/tests/ui/unnecessary_cast_fixable.fixed

31 lines
489 B
Rust
Raw Normal View History

// run-rustfix
#![warn(clippy::unnecessary_cast)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
fn main() {
// casting integer literal to float is unnecessary
100_f32;
100_f64;
100_f64;
// Should not trigger
#[rustfmt::skip]
let v = vec!(1);
&v as &[i32];
2020-03-03 17:05:09 +01:00
0x10 as f32;
0o10 as f32;
0b10 as f32;
0x11 as f64;
0o11 as f64;
0b11 as f64;
1_u32;
16_i32;
2_usize;
1.0_f64;
0.5_f32;
1.0 as u16;
}