Merge #1049
1049: Add description & example for inlining local variable r=matklad a=gfreezy Co-authored-by: gfreezy <gfreezy@gmail.com>
This commit is contained in:
commit
bb77bc5c2f
@ -210,7 +210,7 @@ fn main() {
|
||||
}
|
||||
```
|
||||
|
||||
-- Fill struct fields
|
||||
- Fill struct fields
|
||||
|
||||
```rust
|
||||
// before:
|
||||
@ -270,7 +270,22 @@ fn foo() {
|
||||
}
|
||||
```
|
||||
|
||||
-- Remove `dbg!`
|
||||
- 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
|
||||
// before:
|
||||
|
Loading…
x
Reference in New Issue
Block a user