1049: Add description & example for inlining local variable r=matklad a=gfreezy



Co-authored-by: gfreezy <gfreezy@gmail.com>
This commit is contained in:
bors[bot] 2019-03-25 19:46:40 +00:00
commit bb77bc5c2f

View File

@ -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: