mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-11 07:34:22 +00:00
add desc and examples for inline variable action
This commit is contained in:
parent
d88a96bd05
commit
2ca1b2bc8f
1 changed files with 15 additions and 0 deletions
|
@ -270,6 +270,21 @@ fn foo() {
|
|||
}
|
||||
```
|
||||
|
||||
- Inline local variable:
|
||||
|
||||
```rust
|
||||
// before:
|
||||
fn foo() {
|
||||
let a<|> = 1 + 1;
|
||||
let b = a * 10;
|
||||
}
|
||||
|
||||
// after:
|
||||
fn foo() {
|
||||
let b = (1 + 1) * 10;
|
||||
}
|
||||
```
|
||||
|
||||
-- Remove `dbg!`
|
||||
|
||||
```rust
|
||||
|
|
Loading…
Reference in a new issue