Skip to content

Commit 4f3474e

Browse files
committed
map_unit_fn: rename tests to fixable
1 parent 8000472 commit 4f3474e

4 files changed

+48
-48
lines changed

tests/ui/option_map_unit_fn.stderr renamed to tests/ui/option_map_unit_fn_fixable.stderr

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: called `map(f)` on an Option value where `f` is a unit function
2-
--> $DIR/option_map_unit_fn.rs:32:5
2+
--> $DIR/option_map_unit_fn_fixable.rs:32:5
33
|
44
LL | x.field.map(do_nothing);
55
| ^^^^^^^^^^^^^^^^^^^^^^^-
@@ -9,151 +9,151 @@ LL | x.field.map(do_nothing);
99
= note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
1010

1111
error: called `map(f)` on an Option value where `f` is a unit function
12-
--> $DIR/option_map_unit_fn.rs:34:5
12+
--> $DIR/option_map_unit_fn_fixable.rs:34:5
1313
|
1414
LL | x.field.map(do_nothing);
1515
| ^^^^^^^^^^^^^^^^^^^^^^^-
1616
| |
1717
| help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
1818

1919
error: called `map(f)` on an Option value where `f` is a unit function
20-
--> $DIR/option_map_unit_fn.rs:36:5
20+
--> $DIR/option_map_unit_fn_fixable.rs:36:5
2121
|
2222
LL | x.field.map(diverge);
2323
| ^^^^^^^^^^^^^^^^^^^^-
2424
| |
2525
| help: try this: `if let Some(x_field) = x.field { diverge(...) }`
2626

2727
error: called `map(f)` on an Option value where `f` is a unit closure
28-
--> $DIR/option_map_unit_fn.rs:42:5
28+
--> $DIR/option_map_unit_fn_fixable.rs:42:5
2929
|
3030
LL | x.field.map(|value| x.do_option_nothing(value + captured));
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
3232
| |
3333
| help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
3434

3535
error: called `map(f)` on an Option value where `f` is a unit closure
36-
--> $DIR/option_map_unit_fn.rs:44:5
36+
--> $DIR/option_map_unit_fn_fixable.rs:44:5
3737
|
3838
LL | x.field.map(|value| { x.do_option_plus_one(value + captured); });
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4040
| |
4141
| help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
4242

4343
error: called `map(f)` on an Option value where `f` is a unit closure
44-
--> $DIR/option_map_unit_fn.rs:47:5
44+
--> $DIR/option_map_unit_fn_fixable.rs:47:5
4545
|
4646
LL | x.field.map(|value| do_nothing(value + captured));
4747
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
4848
| |
4949
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
5050

5151
error: called `map(f)` on an Option value where `f` is a unit closure
52-
--> $DIR/option_map_unit_fn.rs:49:5
52+
--> $DIR/option_map_unit_fn_fixable.rs:49:5
5353
|
5454
LL | x.field.map(|value| { do_nothing(value + captured) });
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
5656
| |
5757
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
5858

5959
error: called `map(f)` on an Option value where `f` is a unit closure
60-
--> $DIR/option_map_unit_fn.rs:51:5
60+
--> $DIR/option_map_unit_fn_fixable.rs:51:5
6161
|
6262
LL | x.field.map(|value| { do_nothing(value + captured); });
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
6464
| |
6565
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
6666

6767
error: called `map(f)` on an Option value where `f` is a unit closure
68-
--> $DIR/option_map_unit_fn.rs:53:5
68+
--> $DIR/option_map_unit_fn_fixable.rs:53:5
6969
|
7070
LL | x.field.map(|value| { { do_nothing(value + captured); } });
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
7272
| |
7373
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
7474

7575
error: called `map(f)` on an Option value where `f` is a unit closure
76-
--> $DIR/option_map_unit_fn.rs:56:5
76+
--> $DIR/option_map_unit_fn_fixable.rs:56:5
7777
|
7878
LL | x.field.map(|value| diverge(value + captured));
7979
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8080
| |
8181
| help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
8282

8383
error: called `map(f)` on an Option value where `f` is a unit closure
84-
--> $DIR/option_map_unit_fn.rs:58:5
84+
--> $DIR/option_map_unit_fn_fixable.rs:58:5
8585
|
8686
LL | x.field.map(|value| { diverge(value + captured) });
8787
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
8888
| |
8989
| help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
9090

9191
error: called `map(f)` on an Option value where `f` is a unit closure
92-
--> $DIR/option_map_unit_fn.rs:60:5
92+
--> $DIR/option_map_unit_fn_fixable.rs:60:5
9393
|
9494
LL | x.field.map(|value| { diverge(value + captured); });
9595
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
9696
| |
9797
| help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
9898

9999
error: called `map(f)` on an Option value where `f` is a unit closure
100-
--> $DIR/option_map_unit_fn.rs:62:5
100+
--> $DIR/option_map_unit_fn_fixable.rs:62:5
101101
|
102102
LL | x.field.map(|value| { { diverge(value + captured); } });
103103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
104104
| |
105105
| help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
106106

107107
error: called `map(f)` on an Option value where `f` is a unit closure
108-
--> $DIR/option_map_unit_fn.rs:67:5
108+
--> $DIR/option_map_unit_fn_fixable.rs:67:5
109109
|
110110
LL | x.field.map(|value| { let y = plus_one(value + captured); });
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
112112
| |
113113
| help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
114114

115115
error: called `map(f)` on an Option value where `f` is a unit closure
116-
--> $DIR/option_map_unit_fn.rs:69:5
116+
--> $DIR/option_map_unit_fn_fixable.rs:69:5
117117
|
118118
LL | x.field.map(|value| { plus_one(value + captured); });
119119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
120120
| |
121121
| help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
122122

123123
error: called `map(f)` on an Option value where `f` is a unit closure
124-
--> $DIR/option_map_unit_fn.rs:71:5
124+
--> $DIR/option_map_unit_fn_fixable.rs:71:5
125125
|
126126
LL | x.field.map(|value| { { plus_one(value + captured); } });
127127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
128128
| |
129129
| help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
130130

131131
error: called `map(f)` on an Option value where `f` is a unit closure
132-
--> $DIR/option_map_unit_fn.rs:74:5
132+
--> $DIR/option_map_unit_fn_fixable.rs:74:5
133133
|
134134
LL | x.field.map(|ref value| { do_nothing(value + captured) });
135135
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
136136
| |
137137
| help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
138138

139139
error: called `map(f)` on an Option value where `f` is a unit closure
140-
--> $DIR/option_map_unit_fn.rs:77:5
140+
--> $DIR/option_map_unit_fn_fixable.rs:77:5
141141
|
142142
LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
143143
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
144144
| |
145145
| help: try this: `if let Some(value) = x.field { ... }`
146146

147147
error: called `map(f)` on an Option value where `f` is a unit closure
148-
--> $DIR/option_map_unit_fn.rs:79:5
148+
--> $DIR/option_map_unit_fn_fixable.rs:79:5
149149
|
150150
LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
151151
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
152152
| |
153153
| help: try this: `if let Some(value) = x.field { ... }`
154154

155155
error: called `map(f)` on an Option value where `f` is a unit closure
156-
--> $DIR/option_map_unit_fn.rs:83:5
156+
--> $DIR/option_map_unit_fn_fixable.rs:83:5
157157
|
158158
LL | x.field.map(|value| {
159159
| _____^
@@ -167,39 +167,39 @@ LL | || });
167167
|
168168

169169
error: called `map(f)` on an Option value where `f` is a unit closure
170-
--> $DIR/option_map_unit_fn.rs:87:5
170+
--> $DIR/option_map_unit_fn_fixable.rs:87:5
171171
|
172172
LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
173173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
174174
| |
175175
| help: try this: `if let Some(value) = x.field { ... }`
176176

177177
error: called `map(f)` on an Option value where `f` is a unit function
178-
--> $DIR/option_map_unit_fn.rs:90:5
178+
--> $DIR/option_map_unit_fn_fixable.rs:90:5
179179
|
180180
LL | Some(42).map(diverge);
181181
| ^^^^^^^^^^^^^^^^^^^^^-
182182
| |
183183
| help: try this: `if let Some(_) = Some(42) { diverge(...) }`
184184

185185
error: called `map(f)` on an Option value where `f` is a unit function
186-
--> $DIR/option_map_unit_fn.rs:91:5
186+
--> $DIR/option_map_unit_fn_fixable.rs:91:5
187187
|
188188
LL | "12".parse::<i32>().ok().map(diverge);
189189
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
190190
| |
191191
| help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
192192

193193
error: called `map(f)` on an Option value where `f` is a unit function
194-
--> $DIR/option_map_unit_fn.rs:92:5
194+
--> $DIR/option_map_unit_fn_fixable.rs:92:5
195195
|
196196
LL | Some(plus_one(1)).map(do_nothing);
197197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
198198
| |
199199
| help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
200200

201201
error: called `map(f)` on an Option value where `f` is a unit function
202-
--> $DIR/option_map_unit_fn.rs:96:5
202+
--> $DIR/option_map_unit_fn_fixable.rs:96:5
203203
|
204204
LL | y.map(do_nothing);
205205
| ^^^^^^^^^^^^^^^^^-

0 commit comments

Comments
 (0)