rust-analyzer/crates/ide_assists/src
bors[bot] c0459c5357
Merge #7956
7956: Add assist to convert for_each into for loops r=Veykril a=SaiintBrisson

This PR resolves #7821.
Adds an assist to that converts an `Iterator::for_each` into a for loop: 

```rust
fn main() {
    let vec = vec![(1, 2), (2, 3), (3, 4)];
    x.iter().for_each(|(x, y)| {
        println!("x: {}, y: {}", x, y);
    })
}
```
becomes
```rust
fn main() {
    let vec = vec![(1, 2), (2, 3), (3, 4)];
    for (x, y) in x.iter() {
        println!("x: {}, y: {}", x, y);
    });
}
```

Co-authored-by: Luiz Carlos Mourão Paes de Carvalho <luizcarlosmpc@gmail.com>
Co-authored-by: Luiz Carlos <luizcarlosmpc@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-12 14:45:04 +00:00
..
handlers Merge #7956 2021-03-12 14:45:04 +00:00
tests Fix convert_iter_for_each_to_for doctest 2021-03-12 15:42:53 +01:00
utils Compress tests 2021-03-02 18:35:52 +03:00
assist_config.rs 7526: Rename crate assists to ide_assists. 2021-02-23 00:59:16 +05:30
assist_context.rs 7526: Rename crate assists to ide_assists. 2021-02-23 00:59:16 +05:30
ast_transform.rs 7526: Rename crate assists to ide_assists. 2021-02-23 00:59:16 +05:30
lib.rs feat: add assist to conver for_each into for loops 2021-03-09 22:58:17 -03:00
tests.rs Make group imports configurable 2021-03-07 10:15:17 +02:00
utils.rs pull out suggest_name::* to utils; enchance heuristics 2021-03-02 16:25:22 +03:00