]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_cast_fixable.fixed
Address review comments
[rust.git] / tests / ui / unnecessary_cast_fixable.fixed
1 // run-rustfix
2
3 #![warn(clippy::unnecessary_cast)]
4 #![allow(clippy::no_effect, clippy::unnecessary_operation)]
5
6 fn main() {
7     // casting integer literal to float is unnecessary
8     100_f32;
9     100_f64;
10     100_f64;
11     // Should not trigger
12     #[rustfmt::skip]
13     let v = vec!(1);
14     &v as &[i32];
15     0x10 as f32;
16     0o10 as f32;
17     0b10 as f32;
18     0x11 as f64;
19     0o11 as f64;
20     0b11 as f64;
21
22     1_u32;
23     0x10_i32;
24     0b10_usize;
25     0o73_u16;
26     1_000_000_000_u32;
27
28     1.0_f64;
29     0.5_f32;
30
31     1.0 as u16;
32 }