Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Nov 6, 2025

Example

fn main() {
    let x = vec![1, 2, 3];
    for$0 v in x {
        let y = v * 2;
    };
}

Before this PR

fn main() {
    let x = vec![1, 2, 3];
    let mut tmp = x.into_iter();
    while let Some(v) = tmp.next() {
        let y = v * 2;
    };
}

After this PR

fn main() {
    let x = vec![1, 2, 3];
    let mut iter = x.into_iter();
    while let Some(v) = iter.next() {
        let y = v * 2;
    };
}

Example
---
```rust
fn main() {
    let x = vec![1, 2, 3];
    for$0 v in x {
        let y = v * 2;
    };
}
```

**Before this PR**

```rust
fn main() {
    let x = vec![1, 2, 3];
    let mut tmp = x.into_iter();
    while let Some(v) = tmp.next() {
        let y = v * 2;
    };
}
```

**After this PR**

```rust
fn main() {
    let x = vec![1, 2, 3];
    let mut iter = x.into_iter();
    while let Some(v) = iter.next() {
        let y = v * 2;
    };
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants