1
1
error: unnecessary map of the identity function
2
- --> tests/ui/map_identity.rs:7 :47
2
+ --> tests/ui/map_identity.rs:8 :47
3
3
|
4
4
LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect();
5
5
| ^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
@@ -8,25 +8,25 @@ LL | let _: Vec<_> = x.iter().map(not_identity).map(|x| return x).collect();
8
8
= help: to override `-D warnings` add `#[allow(clippy::map_identity)]`
9
9
10
10
error: unnecessary map of the identity function
11
- --> tests/ui/map_identity.rs:9 :57
11
+ --> tests/ui/map_identity.rs:10 :57
12
12
|
13
13
LL | let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
14
14
| ^^^^^^^^^^^ help: remove the call to `map`
15
15
16
16
error: unnecessary map of the identity function
17
- --> tests/ui/map_identity.rs:9 :29
17
+ --> tests/ui/map_identity.rs:10 :29
18
18
|
19
19
LL | let _: Vec<_> = x.iter().map(std::convert::identity).map(|y| y).collect();
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
21
21
22
22
error: unnecessary map of the identity function
23
- --> tests/ui/map_identity.rs:12 :32
23
+ --> tests/ui/map_identity.rs:13 :32
24
24
|
25
25
LL | let _: Option<u8> = Some(3).map(|x| x);
26
26
| ^^^^^^^^^^^ help: remove the call to `map`
27
27
28
28
error: unnecessary map of the identity function
29
- --> tests/ui/map_identity.rs:14 :36
29
+ --> tests/ui/map_identity.rs:15 :36
30
30
|
31
31
LL | let _: Result<i8, f32> = Ok(-3).map(|x| {
32
32
| ____________________________________^
@@ -36,19 +36,19 @@ LL | | });
36
36
| |______^ help: remove the call to `map`
37
37
38
38
error: unnecessary map of the identity function
39
- --> tests/ui/map_identity.rs:25 :36
39
+ --> tests/ui/map_identity.rs:26 :36
40
40
|
41
41
LL | let _: Result<u32, u32> = Ok(1).map_err(|a| a);
42
42
| ^^^^^^^^^^^^^^^ help: remove the call to `map_err`
43
43
44
44
error: unnecessary map of the identity function
45
- --> tests/ui/map_identity.rs:36 :22
45
+ --> tests/ui/map_identity.rs:37 :22
46
46
|
47
47
LL | let _ = x.clone().map(|(x, y)| (x, y));
48
48
| ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
49
49
50
50
error: unnecessary map of the identity function
51
- --> tests/ui/map_identity.rs:38 :22
51
+ --> tests/ui/map_identity.rs:39 :22
52
52
|
53
53
LL | let _ = x.clone().map(|(x, y)| {
54
54
| ______________________^
@@ -58,76 +58,100 @@ LL | | });
58
58
| |______^ help: remove the call to `map`
59
59
60
60
error: unnecessary map of the identity function
61
- --> tests/ui/map_identity.rs:42 :22
61
+ --> tests/ui/map_identity.rs:43 :22
62
62
|
63
63
LL | let _ = x.clone().map(|(x, y)| return (x, y));
64
64
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
65
65
66
66
error: unnecessary map of the identity function
67
- --> tests/ui/map_identity.rs:46 :22
67
+ --> tests/ui/map_identity.rs:47 :22
68
68
|
69
69
LL | let _ = y.clone().map(|(x, y, (z, (w,)))| (x, y, (z, (w,))));
70
70
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
71
71
72
72
error: unnecessary map of the identity function
73
- --> tests/ui/map_identity.rs:76 :30
73
+ --> tests/ui/map_identity.rs:77 :30
74
74
|
75
75
LL | let _ = x.iter().copied().map(|(x, y)| (x, y));
76
76
| ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
77
77
78
78
error: unnecessary map of the identity function
79
- --> tests/ui/map_identity.rs:88:15
79
+ --> tests/ui/map_identity.rs:86:15
80
+ |
81
+ LL | let _ = it.map(|x| x).next();
82
+ | ^^^^^^^^^^^
83
+ |
84
+ help: remove the call to `map`, and make `it` mutable
85
+ |
86
+ LL ~ let mut it = [1, 2, 3].into_iter();
87
+ LL ~ let _ = it.next();
88
+ |
89
+
90
+ error: unnecessary map of the identity function
91
+ --> tests/ui/map_identity.rs:93:23
92
+ |
93
+ LL | let _ = subindex.0.map(|n| n).next();
94
+ | ^^^^^^^^^^^
95
+ |
96
+ help: remove the call to `map`, and make `subindex` mutable
97
+ |
98
+ LL ~ let mut subindex = (index.by_ref().take(3), 42);
99
+ LL ~ let _ = subindex.0.next();
100
+ |
101
+
102
+ error: unnecessary map of the identity function
103
+ --> tests/ui/map_identity.rs:100:15
80
104
|
81
105
LL | let _ = it.map(|x| x).next();
82
106
| ^^^^^^^^^^^ help: remove the call to `map`
83
107
84
108
error: unnecessary map of the identity function
85
- --> tests/ui/map_identity.rs:93 :19
109
+ --> tests/ui/map_identity.rs:106 :19
86
110
|
87
111
LL | let _ = { it }.map(|x| x).next();
88
112
| ^^^^^^^^^^^ help: remove the call to `map`
89
113
90
114
error: unnecessary map of the identity function
91
- --> tests/ui/map_identity.rs:105 :30
115
+ --> tests/ui/map_identity.rs:119 :30
92
116
|
93
117
LL | let _ = x.iter().copied().map(|[x, y]| [x, y]);
94
118
| ^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
95
119
96
120
error: unnecessary map of the identity function
97
- --> tests/ui/map_identity.rs:131 :26
121
+ --> tests/ui/map_identity.rs:145 :26
98
122
|
99
123
LL | let _ = x.into_iter().map(|Foo { foo, bar }| Foo { foo, bar });
100
124
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
101
125
102
126
error: unnecessary map of the identity function
103
- --> tests/ui/map_identity.rs:135 :26
127
+ --> tests/ui/map_identity.rs:149 :26
104
128
|
105
129
LL | let _ = x.into_iter().map(|Foo { foo, bar }| foo::Foo { foo, bar });
106
130
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
107
131
108
132
error: unnecessary map of the identity function
109
- --> tests/ui/map_identity.rs:143 :26
133
+ --> tests/ui/map_identity.rs:157 :26
110
134
|
111
135
LL | let _ = x.into_iter().map(|Foo { foo, bar }| Foo { foo: foo, bar: bar });
112
136
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
113
137
114
138
error: unnecessary map of the identity function
115
- --> tests/ui/map_identity.rs:147 :26
139
+ --> tests/ui/map_identity.rs:161 :26
116
140
|
117
141
LL | let _ = x.into_iter().map(|Foo { foo, bar }| Foo { bar, foo });
118
142
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
119
143
120
144
error: unnecessary map of the identity function
121
- --> tests/ui/map_identity.rs:157 :26
145
+ --> tests/ui/map_identity.rs:171 :26
122
146
|
123
147
LL | let _ = x.into_iter().map(|Foo2(foo, bar)| Foo2(foo, bar));
124
148
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
125
149
126
150
error: unnecessary map of the identity function
127
- --> tests/ui/map_identity.rs:161 :26
151
+ --> tests/ui/map_identity.rs:175 :26
128
152
|
129
153
LL | let _ = x.into_iter().map(|Foo2(foo, bar)| foo::Foo2(foo, bar));
130
154
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the call to `map`
131
155
132
- error: aborting due to 20 previous errors
156
+ error: aborting due to 22 previous errors
133
157
0 commit comments