2 #![warn(clippy::map_identity)]
3 #![allow(clippy::needless_return)]
6 let x: [u16; 3] = [1, 2, 3];
8 let _: Vec<_> = x.iter().map(not_identity).collect();
9 let _: Vec<_> = x.iter().collect();
10 let _: Option<u8> = Some(3);
11 let _: Result<i8, f32> = Ok(-3);
13 let _: Vec<_> = x.iter().map(|x| 2 * x).collect();
14 let _: Vec<_> = x.iter().map(not_identity).map(|x| return x - 4).collect();
15 let _: Option<u8> = None.map(|x: u8| x - 1);
16 let _: Result<i8, f32> = Err(2.3).map(|x: i8| {
21 fn not_identity(x: &u16) -> u16 {