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') 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 From 8cb3041a0cbd64b7ddc46fbf81a3c0088af7bcf2 Mon Sep 17 00:00:00 2001 From: gfreezy Date: Mon, 25 Mar 2019 23:15:52 +0800 Subject: markdown syntax --- docs/user/features.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/user/features.md b/docs/user/features.md index 59ee3dbd5..7173d88e9 100644 --- a/docs/user/features.md +++ b/docs/user/features.md @@ -210,7 +210,7 @@ fn main() { } ``` --- Fill struct fields +- Fill struct fields ```rust // before: @@ -285,7 +285,7 @@ fn foo() { } ``` --- Remove `dbg!` +- Remove `dbg!` ```rust // before: -- cgit v1.2.3