From d1c21b85cf7c8ca55bf0f83f2359d9018e321705 Mon Sep 17 00:00:00 2001 From: Unreal Hoang Date: Thu, 2 May 2019 00:57:16 +0900 Subject: add complex match case and documentation --- docs/user/features.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docs/user') diff --git a/docs/user/features.md b/docs/user/features.md index cbfc491b2..a714574fb 100644 --- a/docs/user/features.md +++ b/docs/user/features.md @@ -388,6 +388,24 @@ fn foo() { } ``` +- Move guard expression to match arm body +```rust +//before: +fn f() { + match x { + <|>y @ 4 | y @ 5 if y > 5 => true, + _ => false + } +} +//after: +fn f() { + match x { + y @ 4 | y @ 5 => if y > 5 { <|>true }, + _ => false + } +} +``` + ### Magic Completions In addition to usual reference completion, rust-analyzer provides some ✨magic✨ -- cgit v1.2.3