fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.7 KiB44 linesraw
1error: unnecessary map of the identity function
2  --> $DIR/map_identity.rs:7:47
3   |
4LL |     let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect();
5   |                                               ^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
6   |
7   = note: `-D clippy::map-identity` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::map_identity)]`
9
10error: unnecessary map of the identity function
11  --> $DIR/map_identity.rs:8:57
12   |
13LL |     let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
14   |                                                         ^^^^^^^^^^^ help: remove the call to `map`
15
16error: unnecessary map of the identity function
17  --> $DIR/map_identity.rs:8:29
18   |
19LL |     let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
20   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
21
22error: unnecessary map of the identity function
23  --> $DIR/map_identity.rs:9:32
24   |
25LL |     let _: Option<u8> = Some(3).map(|x| x);
26   |                                ^^^^^^^^^^^ help: remove the call to `map`
27
28error: unnecessary map of the identity function
29  --> $DIR/map_identity.rs:10:36
30   |
31LL |       let _: Result<i8, f32> = Ok(-3).map(|x| {
32   |  ____________________________________^
33LL | |         return x;
34LL | |     });
35   | |______^ help: remove the call to `map`
36
37error: unnecessary map of the identity function
38  --> $DIR/map_identity.rs:20:36
39   |
40LL |     let _: Result<u32, u32> = Ok(1).map_err(|a| a);
41   |                                    ^^^^^^^^^^^^^^^ help: remove the call to `map_err`
42
43error: aborting due to 6 previous errors
44