Skip to content

fix: Improve add some on block like expression#21953

Draft
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:add-some-instead-wrap-some
Draft

fix: Improve add some on block like expression#21953
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:add-some-instead-wrap-some

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

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

After #21952, make the PR also support macros

Example

fn foo() -> Result<(), ()> {
    for _ in 0..5 {}$0
}

Before this PR

fn foo() -> Result<(), ()> {
    Ok(for _ in 0..5 {})
}

After this PR

fn foo() -> Result<(), ()> {
    for _ in 0..5 {}
    Ok(())
}

Example
---
```rust
fn foo() -> Result<(), ()> {
    for _ in 0..5 {}$0
}
```

**Before this PR**

```rust
fn foo() -> Result<(), ()> {
    Ok(for _ in 0..5 {})
}
```

**After this PR**

```rust
fn foo() -> Result<(), ()> {
    for _ in 0..5 {}
    Ok(())
}
```
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.

1 participant