@@ -22,7 +22,7 @@ fn main() {
22
22
23
23
[discrete]
24
24
=== `add_hash`
25
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L92 [raw_string.rs]
25
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L91 [raw_string.rs]
26
26
27
27
Adds a hash to a raw string literal.
28
28
@@ -141,7 +141,7 @@ struct Point<'a> {
141
141
142
142
[discrete]
143
143
=== `add_turbo_fish`
144
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_turbo_fish.rs#L10 [add_turbo_fish.rs]
144
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_turbo_fish.rs#L9 [add_turbo_fish.rs]
145
145
146
146
Adds `::<_>` to a call of a generic method or function.
147
147
@@ -164,7 +164,7 @@ fn main() {
164
164
165
165
[discrete]
166
166
=== `apply_demorgan`
167
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/apply_demorgan.rs#L6 [apply_demorgan.rs]
167
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/apply_demorgan.rs#L7 [apply_demorgan.rs]
168
168
169
169
Apply https://en.wikipedia.org/wiki/De_Morgan%27s_laws[De Morgan's law].
170
170
This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -211,7 +211,7 @@ fn main() {
211
211
212
212
[discrete]
213
213
=== `change_visibility`
214
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/change_visibility.rs#L11 [change_visibility.rs]
214
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/change_visibility.rs#L10 [change_visibility.rs]
215
215
216
216
Adds or changes existing visibility specifier.
217
217
@@ -243,6 +243,33 @@ const _: i32 = 0b1010;
243
243
```
244
244
245
245
246
+ [discrete]
247
+ === `convert_iter_for_each_to_for`
248
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/convert_iter_for_each_to_for.rs#L9[convert_iter_for_each_to_for.rs]
249
+
250
+ Converts an Iterator::for_each function into a for loop.
251
+
252
+ .Before
253
+ ```rust
254
+ fn main() {
255
+ let iter = SomeIter;
256
+ iter.for_each┃(|(x, y)| {
257
+ println!("x: {}, y: {}", x, y);
258
+ });
259
+ }
260
+ ```
261
+
262
+ .After
263
+ ```rust
264
+ fn main() {
265
+ let iter = SomeIter;
266
+ for (x, y) in iter {
267
+ println!("x: {}, y: {}", x, y);
268
+ }
269
+ }
270
+ ```
271
+
272
+
246
273
[discrete]
247
274
=== `convert_to_guarded_return`
248
275
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/early_return.rs#L21[early_return.rs]
@@ -304,7 +331,7 @@ fn qux(bar: Bar, baz: Baz) {}
304
331
305
332
[discrete]
306
333
=== `extract_function`
307
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L30 [extract_function.rs]
334
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L29 [extract_function.rs]
308
335
309
336
Extracts selected statements into new function.
310
337
@@ -354,7 +381,7 @@ enum A { One(One) }
354
381
355
382
[discrete]
356
383
=== `extract_variable`
357
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_variable.rs#L13 [extract_variable.rs]
384
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_variable.rs#L12 [extract_variable.rs]
358
385
359
386
Extracts subexpression into a variable.
360
387
@@ -376,7 +403,7 @@ fn main() {
376
403
377
404
[discrete]
378
405
=== `fill_match_arms`
379
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/fill_match_arms.rs#L15 [fill_match_arms.rs]
406
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/fill_match_arms.rs#L14 [fill_match_arms.rs]
380
407
381
408
Adds missing clauses to a `match` expression.
382
409
@@ -492,7 +519,7 @@ fn foo<T: Copy + Clone>() { }
492
519
493
520
[discrete]
494
521
=== `generate_default_from_enum_variant`
495
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_default_from_enum_variant.rs#L8 [generate_default_from_enum_variant.rs]
522
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_default_from_enum_variant.rs#L7 [generate_default_from_enum_variant.rs]
496
523
497
524
Adds a Default impl for an enum using a variant.
498
525
@@ -523,7 +550,7 @@ impl Default for Version {
523
550
524
551
[discrete]
525
552
=== `generate_default_from_new`
526
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_default_from_new.rs#L12 [generate_default_from_new.rs]
553
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_default_from_new.rs#L11 [generate_default_from_new.rs]
527
554
528
555
Generates default implementation from new method.
529
556
@@ -680,7 +707,7 @@ impl Value {
680
707
681
708
[discrete]
682
709
=== `generate_from_impl_for_enum`
683
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs#L8 [generate_from_impl_for_enum.rs]
710
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_from_impl_for_enum.rs#L7 [generate_from_impl_for_enum.rs]
684
711
685
712
Adds a From impl for an enum variant with one tuple field.
686
713
@@ -868,7 +895,7 @@ impl Person {
868
895
869
896
[discrete]
870
897
=== `infer_function_return_type`
871
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/infer_function_return_type.rs#L7 [infer_function_return_type.rs]
898
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/infer_function_return_type.rs#L6 [infer_function_return_type.rs]
872
899
873
900
Adds the return type to a function or closure inferred from its tail expression if it doesn't have a return
874
901
type specified. This assists is useable in a functions or closures tail expression or return type position.
@@ -886,7 +913,7 @@ fn foo() -> i32 { 42i32 }
886
913
887
914
[discrete]
888
915
=== `inline_function`
889
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_function.rs#L14 [inline_function.rs]
916
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_function.rs#L13 [inline_function.rs]
890
917
891
918
Inlines a function body.
892
919
@@ -913,7 +940,7 @@ fn main() {
913
940
914
941
[discrete]
915
942
=== `inline_local_variable`
916
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L14 [inline_local_variable.rs]
943
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/inline_local_variable.rs#L13 [inline_local_variable.rs]
917
944
918
945
Inlines local variable.
919
946
@@ -988,7 +1015,7 @@ fn main() {
988
1015
989
1016
[discrete]
990
1017
=== `make_raw_string`
991
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L8 [raw_string.rs]
1018
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L7 [raw_string.rs]
992
1019
993
1020
Adds `r#` to a plain string literal.
994
1021
@@ -1009,7 +1036,7 @@ fn main() {
1009
1036
1010
1037
[discrete]
1011
1038
=== `make_usual_string`
1012
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L50 [raw_string.rs]
1039
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L49 [raw_string.rs]
1013
1040
1014
1041
Turns a raw string into a plain string.
1015
1042
@@ -1163,7 +1190,7 @@ fn handle(action: Action) {
1163
1190
1164
1191
[discrete]
1165
1192
=== `move_module_to_file`
1166
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_module_to_file.rs#L12 [move_module_to_file.rs]
1193
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/move_module_to_file.rs#L11 [move_module_to_file.rs]
1167
1194
1168
1195
Moves inline module's contents to a separate file.
1169
1196
@@ -1182,7 +1209,7 @@ mod foo;
1182
1209
1183
1210
[discrete]
1184
1211
=== `pull_assignment_up`
1185
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/pull_assignment_up.rs#L12 [pull_assignment_up.rs]
1212
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/pull_assignment_up.rs#L11 [pull_assignment_up.rs]
1186
1213
1187
1214
Extracts variable assignment to outside an if or match statement.
1188
1215
@@ -1215,7 +1242,7 @@ fn main() {
1215
1242
1216
1243
[discrete]
1217
1244
=== `qualify_path`
1218
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L20 [qualify_path.rs]
1245
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/qualify_path.rs#L22 [qualify_path.rs]
1219
1246
1220
1247
If the name is unresolved, provides all possible qualified paths for it.
1221
1248
@@ -1257,7 +1284,7 @@ fn main() {
1257
1284
1258
1285
[discrete]
1259
1286
=== `remove_hash`
1260
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L120 [raw_string.rs]
1287
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/raw_string.rs#L119 [raw_string.rs]
1261
1288
1262
1289
Removes a hash from a raw string literal.
1263
1290
@@ -1324,7 +1351,7 @@ fn main() {
1324
1351
1325
1352
[discrete]
1326
1353
=== `reorder_fields`
1327
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_fields.rs#L11 [reorder_fields.rs]
1354
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_fields.rs#L10 [reorder_fields.rs]
1328
1355
1329
1356
Reorder the fields of record literals and record patterns in the same order as in
1330
1357
the definition.
@@ -1344,7 +1371,7 @@ const test: Foo = Foo {foo: 1, bar: 0}
1344
1371
1345
1372
[discrete]
1346
1373
=== `reorder_impl`
1347
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_impl.rs#L15 [reorder_impl.rs]
1374
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/reorder_impl.rs#L14 [reorder_impl.rs]
1348
1375
1349
1376
Reorder the methods of an `impl Trait`. The methods will be ordered
1350
1377
in the same order as in the trait definition.
@@ -1384,7 +1411,7 @@ impl Foo for Bar {
1384
1411
1385
1412
[discrete]
1386
1413
=== `replace_derive_with_manual_impl`
1387
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L19 [replace_derive_with_manual_impl.rs]
1414
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L20 [replace_derive_with_manual_impl.rs]
1388
1415
1389
1416
Converts a `derive` impl into a manual one.
1390
1417
@@ -1409,7 +1436,7 @@ impl Debug for S {
1409
1436
1410
1437
[discrete]
1411
1438
=== `replace_for_loop_with_for_each`
1412
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs#L10 [replace_for_loop_with_for_each.rs]
1439
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_for_loop_with_for_each.rs#L9 [replace_for_loop_with_for_each.rs]
1413
1440
1414
1441
Converts a for loop into a for_each loop on the Iterator.
1415
1442
@@ -1545,7 +1572,7 @@ fn handle(action: Action) {
1545
1572
1546
1573
[discrete]
1547
1574
=== `replace_qualified_name_with_use`
1548
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs#L7 [replace_qualified_name_with_use.rs]
1575
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_qualified_name_with_use.rs#L6 [replace_qualified_name_with_use.rs]
1549
1576
1550
1577
Adds a use statement for a given fully-qualified name.
1551
1578
@@ -1654,7 +1681,7 @@ fn arithmetics {
1654
1681
1655
1682
[discrete]
1656
1683
=== `unmerge_use`
1657
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/unmerge_use.rs#L13 [unmerge_use.rs]
1684
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/unmerge_use.rs#L12 [unmerge_use.rs]
1658
1685
1659
1686
Extracts single use item from use list.
1660
1687
@@ -1695,7 +1722,7 @@ fn foo() {
1695
1722
1696
1723
[discrete]
1697
1724
=== `wrap_return_type_in_result`
1698
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/wrap_return_type_in_result.rs#L11 [wrap_return_type_in_result.rs]
1725
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/wrap_return_type_in_result.rs#L10 [wrap_return_type_in_result.rs]
1699
1726
1700
1727
Wrap the function's return type into Result.
1701
1728
0 commit comments