diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-27 12:23:58 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-27 12:23:58 +0000 |
commit | 75f6ab208a2b3e5fea9e8b6362df3fad7308a0d5 (patch) | |
tree | 317b98f12e931eb50d590931f1d0d9b642676717 | |
parent | a4901fdcfd5ef056adc3b1999582e6322e911dbd (diff) | |
parent | dc311b10f3c9b2b16d1d43af98a35dc5f306fc3b (diff) |
Merge #3743
3743: Fix assist description r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r-- | crates/ra_assists/src/handlers/replace_let_with_if_let.rs | 12 | ||||
-rw-r--r-- | docs/user/assists.md | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs index 10e41f97e..bdbaae389 100644 --- a/crates/ra_assists/src/handlers/replace_let_with_if_let.rs +++ b/crates/ra_assists/src/handlers/replace_let_with_if_let.rs | |||
@@ -1,6 +1,12 @@ | |||
1 | use std::iter::once; | ||
2 | |||
1 | use hir::Adt; | 3 | use hir::Adt; |
2 | use ra_syntax::{ | 4 | use ra_syntax::{ |
3 | ast::{self, make}, | 5 | ast::{ |
6 | self, | ||
7 | edit::{AstNodeEdit, IndentLevel}, | ||
8 | make, | ||
9 | }, | ||
4 | AstNode, T, | 10 | AstNode, T, |
5 | }; | 11 | }; |
6 | 12 | ||
@@ -8,12 +14,10 @@ use crate::{ | |||
8 | assist_ctx::{Assist, AssistCtx}, | 14 | assist_ctx::{Assist, AssistCtx}, |
9 | AssistId, | 15 | AssistId, |
10 | }; | 16 | }; |
11 | use ast::edit::{AstNodeEdit, IndentLevel}; | ||
12 | use std::iter::once; | ||
13 | 17 | ||
14 | // Assist: replace_let_with_if_let | 18 | // Assist: replace_let_with_if_let |
15 | // | 19 | // |
16 | // Replaces `if let` with an else branch with a `match` expression. | 20 | // Replaces `let` with an `if-let`. |
17 | // | 21 | // |
18 | // ``` | 22 | // ``` |
19 | // # enum Option<T> { Some(T), None } | 23 | // # enum Option<T> { Some(T), None } |
diff --git a/docs/user/assists.md b/docs/user/assists.md index 2495af20a..94b5ef85d 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -585,7 +585,7 @@ fn handle(action: Action) { | |||
585 | 585 | ||
586 | ## `replace_let_with_if_let` | 586 | ## `replace_let_with_if_let` |
587 | 587 | ||
588 | Replaces `if let` with an else branch with a `match` expression. | 588 | Replaces `let` with an `if-let`. |
589 | 589 | ||
590 | ```rust | 590 | ```rust |
591 | // BEFORE | 591 | // BEFORE |