Skip to content

feat: Add join_let_stmts for join_lines#22220

Open
A4-Tacks wants to merge 2 commits intorust-lang:masterfrom
A4-Tacks:join-let-stmts
Open

feat: Add join_let_stmts for join_lines#22220
A4-Tacks wants to merge 2 commits intorust-lang:masterfrom
A4-Tacks:join-let-stmts

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented Apr 30, 2026

  • Fix redundant space on join empty line

Similar #19777
Working in join_lines is much more troublesome than working in ide-assists

Example

fn foo() {
    $0let x = 2;
    let y = 3;
}

Before this PR

fn foo() {
    let x = 2; let y = 3;
}

After this PR

fn foo() {
    let (x, y) = (2, 3);
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 30, 2026
Example
---
```rust
fn foo() {
    $0let x = 2;
    let y = 3;
}
```

**Before this PR**

```rust
fn foo() {
    let x = 2; let y = 3;
}
```

**After this PR**

```rust
fn foo() {
    $0let (x, y) = (2, 3);
}
```
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