From 2ca1b2bc8fd14cb78c869551c35713603ca785f3 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Mon, 25 Mar 2019 23:14:30 +0800 Subject: add desc and examples for inline variable action --- docs/user/features.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/user/features.md') diff --git a/docs/user/features.md b/docs/user/features.md index b9d2aa84f..59ee3dbd5 100644 --- a/docs/user/features.md +++ b/docs/user/features.md @@ -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 -- cgit v1.2.3