add feature doc

This commit is contained in:
Unreal Hoang 2019-05-16 12:56:54 +09:00
parent 08e954f0fd
commit 079ed6011a
No known key found for this signature in database
GPG key ID: F66217BDC6F37CFA

View file

@ -406,6 +406,35 @@ fn f() {
} }
``` ```
- Move if condition to match arm guard
```rust
// before:
fn f() {
let mut t = 'a';
let chars = "abcd";
match t {
'\r' => if chars.clone().next().is_some() {
t = 'e';<|>
false
},
_ => true
}
}
// after:
fn f() {
let mut t = 'a';
let chars = "abcd";
match t {
'\r' <|>if chars.clone().next().is_some() => {
t = 'e';
false
},
_ => true
}
}
```
### Magic Completions ### Magic Completions
In addition to usual reference completion, rust-analyzer provides some ✨magic✨ In addition to usual reference completion, rust-analyzer provides some ✨magic✨