Skip to content

feat: offer 'add_braces' on bin-expr assignment#21850

Merged
A4-Tacks merged 3 commits intorust-lang:masterfrom
A4-Tacks:add-braces-bin-expr
Mar 21, 2026
Merged

feat: offer 'add_braces' on bin-expr assignment#21850
A4-Tacks merged 3 commits intorust-lang:masterfrom
A4-Tacks:add-braces-bin-expr

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Mar 21, 2026

Close #21834
Close #21842
Implement #21834 (comment)

  • ide-assists: add tests for const, static in add_braces
  • add tests for let-expr in add_braces

Example

fn foo() {
    let x;
    x =$0 n + 100;
}

Before this PR

Assist not applicable

After this PR

fn foo() {
    let x;
    x = {
        n + 100
    };
}

Amit5601 and others added 3 commits March 21, 2026 16:27
Example
---
```rust
fn foo() {
    let x;
    x =$0 n + 100;
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn foo() {
    let x;
    x = {
        n + 100
    };
}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2026
@A4-Tacks A4-Tacks added this pull request to the merge queue Mar 21, 2026
Merged via the queue into rust-lang:master with commit 3c90ed6 Mar 21, 2026
17 checks passed
@A4-Tacks A4-Tacks deleted the add-braces-bin-expr branch March 21, 2026 10:20
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants