mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
38 lines
1.4 KiB
Plaintext
38 lines
1.4 KiB
Plaintext
error: unnecessary map of the identity function
|
|
--> $DIR/map_identity.rs:8:47
|
|
|
|
|
LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect();
|
|
| ^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
|
|
|
|
|
= note: `-D clippy::map-identity` implied by `-D warnings`
|
|
|
|
error: unnecessary map of the identity function
|
|
--> $DIR/map_identity.rs:9:57
|
|
|
|
|
LL | let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
|
|
| ^^^^^^^^^^^ help: remove the call to `map`
|
|
|
|
error: unnecessary map of the identity function
|
|
--> $DIR/map_identity.rs:9:29
|
|
|
|
|
LL | let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
|
|
|
|
error: unnecessary map of the identity function
|
|
--> $DIR/map_identity.rs:10:32
|
|
|
|
|
LL | let _: Option<u8> = Some(3).map(|x| x);
|
|
| ^^^^^^^^^^^ help: remove the call to `map`
|
|
|
|
error: unnecessary map of the identity function
|
|
--> $DIR/map_identity.rs:11:36
|
|
|
|
|
LL | let _: Result<i8, f32> = Ok(-3).map(|x| {
|
|
| ____________________________________^
|
|
LL | | return x;
|
|
LL | | });
|
|
| |______^ help: remove the call to `map`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|