Migrate unwrap_block assist to use SyntaxEditor#21458
Merged
ShoyuVanilla merged 1 commit intorust-lang:masterfrom Jan 14, 2026
Merged
Migrate unwrap_block assist to use SyntaxEditor#21458ShoyuVanilla merged 1 commit intorust-lang:masterfrom
unwrap_block assist to use SyntaxEditor#21458ShoyuVanilla merged 1 commit intorust-lang:masterfrom
Conversation
- Fix invalid match in let-stmt
- Fix multiple statements loses indent
Example
---
```rust
fn main() {
let value = match rel_path {
Ok(rel_path) => {$0
let rel_path = RelativePathBuf::from_path(rel_path).ok()?;
Some((*id, rel_path))
}
Err(_) => None,
};
}
```
**Before this PR**
```rust
fn main() {
let value = let rel_path = RelativePathBuf::from_path(rel_path).ok()?;
let value = Some((*id, rel_path));
}
```
**After this PR**
```rust
fn main() {
let rel_path = RelativePathBuf::from_path(rel_path).ok()?;
let value = Some((*id, rel_path));
}
```
---
```rust
fn main() {
let mut a = {$0
1;
2;
3
};
}
```
**Before this PR**
```rust
fn main() {
1;
2;
let mut a = 3;
}
```
**After this PR**
```rust
fn main() -> i32 {
1;
2;
let mut a = 3;
}
```
Shourya742
approved these changes
Jan 13, 2026
ShoyuVanilla
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example
Before this PR
After this PR
Before this PR
After this PR