@@ -18,109 +18,8 @@ LL | | }
18
18
|
19
19
= note: `-D clippy::new-ret-no-self` implied by `-D warnings`
20
20
21
- error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
22
- --> $DIR/methods.rs:176:13
23
- |
24
- LL | let _ = opt.map(|x| x + 1)
25
- | _____________^
26
- LL | | // Should lint even though this call is on a separate line.
27
- LL | | .unwrap_or(0);
28
- | |____________________________^
29
- |
30
- = note: `-D clippy::option-map-unwrap-or` implied by `-D warnings`
31
- = note: replace `map(|x| x + 1).unwrap_or(0)` with `map_or(0, |x| x + 1)`
32
-
33
- error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
34
- --> $DIR/methods.rs:180:13
35
- |
36
- LL | let _ = opt.map(|x| {
37
- | _____________^
38
- LL | | x + 1
39
- LL | | }
40
- LL | | ).unwrap_or(0);
41
- | |____________________________^
42
-
43
- error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
44
- --> $DIR/methods.rs:184:13
45
- |
46
- LL | let _ = opt.map(|x| x + 1)
47
- | _____________^
48
- LL | | .unwrap_or({
49
- LL | | 0
50
- LL | | });
51
- | |__________________^
52
-
53
- error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
54
- --> $DIR/methods.rs:189:13
55
- |
56
- LL | let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
57
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
- |
59
- = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
60
-
61
- error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
62
- --> $DIR/methods.rs:191:13
63
- |
64
- LL | let _ = opt.map(|x| {
65
- | _____________^
66
- LL | | Some(x + 1)
67
- LL | | }
68
- LL | | ).unwrap_or(None);
69
- | |_____________________^
70
-
71
- error: called `map(f).unwrap_or(None)` on an Option value. This can be done more directly by calling `and_then(f)` instead
72
- --> $DIR/methods.rs:195:13
73
- |
74
- LL | let _ = opt
75
- | _____________^
76
- LL | | .map(|x| Some(x + 1))
77
- LL | | .unwrap_or(None);
78
- | |________________________^
79
- |
80
- = note: replace `map(|x| Some(x + 1)).unwrap_or(None)` with `and_then(|x| Some(x + 1))`
81
-
82
- error: called `map(f).unwrap_or(a)` on an Option value. This can be done more directly by calling `map_or(a, f)` instead
83
- --> $DIR/methods.rs:206:13
84
- |
85
- LL | let _ = Some("prefix").map(|p| format!("{}.", p)).unwrap_or(id);
86
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87
- |
88
- = note: replace `map(|p| format!("{}.", p)).unwrap_or(id)` with `map_or(id, |p| format!("{}.", p))`
89
-
90
- error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
91
- --> $DIR/methods.rs:210:13
92
- |
93
- LL | let _ = opt.map(|x| x + 1)
94
- | _____________^
95
- LL | | // Should lint even though this call is on a separate line.
96
- LL | | .unwrap_or_else(|| 0);
97
- | |____________________________________^
98
- |
99
- = note: `-D clippy::option-map-unwrap-or-else` implied by `-D warnings`
100
- = note: replace `map(|x| x + 1).unwrap_or_else(|| 0)` with `map_or_else(|| 0, |x| x + 1)`
101
-
102
- error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
103
- --> $DIR/methods.rs:214:13
104
- |
105
- LL | let _ = opt.map(|x| {
106
- | _____________^
107
- LL | | x + 1
108
- LL | | }
109
- LL | | ).unwrap_or_else(|| 0);
110
- | |____________________________________^
111
-
112
- error: called `map(f).unwrap_or_else(g)` on an Option value. This can be done more directly by calling `map_or_else(g, f)` instead
113
- --> $DIR/methods.rs:218:13
114
- |
115
- LL | let _ = opt.map(|x| x + 1)
116
- | _____________^
117
- LL | | .unwrap_or_else(||
118
- LL | | 0
119
- LL | | );
120
- | |_________________^
121
-
122
21
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
123
- --> $DIR/methods.rs:248 :13
22
+ --> $DIR/methods.rs:173 :13
124
23
|
125
24
LL | let _ = v.iter().filter(|&x| *x < 0).next();
126
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -129,7 +28,7 @@ LL | let _ = v.iter().filter(|&x| *x < 0).next();
129
28
= note: replace `filter(|&x| *x < 0).next()` with `find(|&x| *x < 0)`
130
29
131
30
error: called `filter(p).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(p)` instead.
132
- --> $DIR/methods.rs:251 :13
31
+ --> $DIR/methods.rs:176 :13
133
32
|
134
33
LL | let _ = v.iter().filter(|&x| {
135
34
| _____________^
@@ -139,33 +38,33 @@ LL | | ).next();
139
38
| |___________________________^
140
39
141
40
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
142
- --> $DIR/methods.rs:268 :22
41
+ --> $DIR/methods.rs:193 :22
143
42
|
144
43
LL | let _ = v.iter().find(|&x| *x < 0).is_some();
145
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x < 0)`
146
45
|
147
46
= note: `-D clippy::search-is-some` implied by `-D warnings`
148
47
149
48
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
150
- --> $DIR/methods.rs:269 :20
49
+ --> $DIR/methods.rs:194 :20
151
50
|
152
51
LL | let _ = (0..1).find(|x| **y == *x).is_some(); // one dereference less
153
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| **y == x)`
154
53
155
54
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
156
- --> $DIR/methods.rs:270 :20
55
+ --> $DIR/methods.rs:195 :20
157
56
|
158
57
LL | let _ = (0..1).find(|x| *x == 0).is_some();
159
58
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| x == 0)`
160
59
161
60
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
162
- --> $DIR/methods.rs:271 :22
61
+ --> $DIR/methods.rs:196 :22
163
62
|
164
63
LL | let _ = v.iter().find(|x| **x == 0).is_some();
165
64
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|x| *x == 0)`
166
65
167
66
error: called `is_some()` after searching an `Iterator` with find. This is more succinctly expressed by calling `any()`.
168
- --> $DIR/methods.rs:274 :13
67
+ --> $DIR/methods.rs:199 :13
169
68
|
170
69
LL | let _ = v.iter().find(|&x| {
171
70
| _____________^
@@ -175,13 +74,13 @@ LL | | ).is_some();
175
74
| |______________________________^
176
75
177
76
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
178
- --> $DIR/methods.rs:280 :22
77
+ --> $DIR/methods.rs:205 :22
179
78
|
180
79
LL | let _ = v.iter().position(|&x| x < 0).is_some();
181
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
182
81
183
82
error: called `is_some()` after searching an `Iterator` with position. This is more succinctly expressed by calling `any()`.
184
- --> $DIR/methods.rs:283 :13
83
+ --> $DIR/methods.rs:208 :13
185
84
|
186
85
LL | let _ = v.iter().position(|&x| {
187
86
| _____________^
@@ -191,13 +90,13 @@ LL | | ).is_some();
191
90
| |______________________________^
192
91
193
92
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
194
- --> $DIR/methods.rs:289 :22
93
+ --> $DIR/methods.rs:214 :22
195
94
|
196
95
LL | let _ = v.iter().rposition(|&x| x < 0).is_some();
197
96
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `any(|&x| x < 0)`
198
97
199
98
error: called `is_some()` after searching an `Iterator` with rposition. This is more succinctly expressed by calling `any()`.
200
- --> $DIR/methods.rs:292 :13
99
+ --> $DIR/methods.rs:217 :13
201
100
|
202
101
LL | let _ = v.iter().rposition(|&x| {
203
102
| _____________^
@@ -206,5 +105,5 @@ LL | | }
206
105
LL | | ).is_some();
207
106
| |______________________________^
208
107
209
- error: aborting due to 23 previous errors
108
+ error: aborting due to 13 previous errors
210
109
0 commit comments