@@ -22,7 +22,7 @@ fn main() {
2222
2323[discrete]
2424=== `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]
2626
2727Adds a hash to a raw string literal.
2828
@@ -141,7 +141,7 @@ struct Point<'a> {
141141
142142[discrete]
143143=== `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]
145145
146146Adds `::<_>` to a call of a generic method or function.
147147
@@ -164,7 +164,7 @@ fn main() {
164164
165165[discrete]
166166=== `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]
168168
169169Apply https://en.wikipedia.org/wiki/De_Morgan%27s_laws[De Morgan's law].
170170This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -211,7 +211,7 @@ fn main() {
211211
212212[discrete]
213213=== `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]
215215
216216Adds or changes existing visibility specifier.
217217
@@ -243,6 +243,33 @@ const _: i32 = 0b1010;
243243```
244244
245245
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+
246273[discrete]
247274=== `convert_to_guarded_return`
248275**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) {}
304331
305332[discrete]
306333=== `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]
308335
309336Extracts selected statements into new function.
310337
@@ -354,7 +381,7 @@ enum A { One(One) }
354381
355382[discrete]
356383=== `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]
358385
359386Extracts subexpression into a variable.
360387
@@ -376,7 +403,7 @@ fn main() {
376403
377404[discrete]
378405=== `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]
380407
381408Adds missing clauses to a `match` expression.
382409
@@ -492,7 +519,7 @@ fn foo<T: Copy + Clone>() { }
492519
493520[discrete]
494521=== `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]
496523
497524Adds a Default impl for an enum using a variant.
498525
@@ -523,7 +550,7 @@ impl Default for Version {
523550
524551[discrete]
525552=== `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]
527554
528555Generates default implementation from new method.
529556
@@ -680,7 +707,7 @@ impl Value {
680707
681708[discrete]
682709=== `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]
684711
685712Adds a From impl for an enum variant with one tuple field.
686713
@@ -868,7 +895,7 @@ impl Person {
868895
869896[discrete]
870897=== `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]
872899
873900Adds the return type to a function or closure inferred from its tail expression if it doesn't have a return
874901type specified. This assists is useable in a functions or closures tail expression or return type position.
@@ -886,7 +913,7 @@ fn foo() -> i32 { 42i32 }
886913
887914[discrete]
888915=== `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]
890917
891918Inlines a function body.
892919
@@ -913,7 +940,7 @@ fn main() {
913940
914941[discrete]
915942=== `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]
917944
918945Inlines local variable.
919946
@@ -988,7 +1015,7 @@ fn main() {
9881015
9891016[discrete]
9901017=== `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]
9921019
9931020Adds `r#` to a plain string literal.
9941021
@@ -1009,7 +1036,7 @@ fn main() {
10091036
10101037[discrete]
10111038=== `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]
10131040
10141041Turns a raw string into a plain string.
10151042
@@ -1163,7 +1190,7 @@ fn handle(action: Action) {
11631190
11641191[discrete]
11651192=== `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]
11671194
11681195Moves inline module's contents to a separate file.
11691196
@@ -1182,7 +1209,7 @@ mod foo;
11821209
11831210[discrete]
11841211=== `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]
11861213
11871214Extracts variable assignment to outside an if or match statement.
11881215
@@ -1215,7 +1242,7 @@ fn main() {
12151242
12161243[discrete]
12171244=== `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]
12191246
12201247If the name is unresolved, provides all possible qualified paths for it.
12211248
@@ -1257,7 +1284,7 @@ fn main() {
12571284
12581285[discrete]
12591286=== `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]
12611288
12621289Removes a hash from a raw string literal.
12631290
@@ -1324,7 +1351,7 @@ fn main() {
13241351
13251352[discrete]
13261353=== `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]
13281355
13291356Reorder the fields of record literals and record patterns in the same order as in
13301357the definition.
@@ -1344,7 +1371,7 @@ const test: Foo = Foo {foo: 1, bar: 0}
13441371
13451372[discrete]
13461373=== `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]
13481375
13491376Reorder the methods of an `impl Trait`. The methods will be ordered
13501377in the same order as in the trait definition.
@@ -1384,7 +1411,7 @@ impl Foo for Bar {
13841411
13851412[discrete]
13861413=== `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]
13881415
13891416Converts a `derive` impl into a manual one.
13901417
@@ -1409,7 +1436,7 @@ impl Debug for S {
14091436
14101437[discrete]
14111438=== `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]
14131440
14141441Converts a for loop into a for_each loop on the Iterator.
14151442
@@ -1545,7 +1572,7 @@ fn handle(action: Action) {
15451572
15461573[discrete]
15471574=== `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]
15491576
15501577Adds a use statement for a given fully-qualified name.
15511578
@@ -1654,7 +1681,7 @@ fn arithmetics {
16541681
16551682[discrete]
16561683=== `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]
16581685
16591686Extracts single use item from use list.
16601687
@@ -1695,7 +1722,7 @@ fn foo() {
16951722
16961723[discrete]
16971724=== `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]
16991726
17001727Wrap the function's return type into Result.
17011728
0 commit comments