diff options
author | Benjamin Coenen <[email protected]> | 2020-04-29 13:53:47 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-29 13:53:47 +0100 |
commit | bbe22640b8d52354c3de3e126c9fcda5b1b174fd (patch) | |
tree | 19faa271db52dd248f2ba0e67f933ba66b19b08a /crates | |
parent | 76733f0cd456005295e60da8c45d74c8c48f177c (diff) |
Add unwrap block assist #4156
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/doc_tests/generated.rs | 2 | ||||
-rw-r--r-- | crates/ra_assists/src/handlers/unwrap_block.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs index 6fe95da6a..b53b97e89 100644 --- a/crates/ra_assists/src/doc_tests/generated.rs +++ b/crates/ra_assists/src/doc_tests/generated.rs | |||
@@ -740,7 +740,7 @@ fn foo() { | |||
740 | "#####, | 740 | "#####, |
741 | r#####" | 741 | r#####" |
742 | fn foo() { | 742 | fn foo() { |
743 | <|>println!("foo"); | 743 | println!("foo"); |
744 | } | 744 | } |
745 | "#####, | 745 | "#####, |
746 | ) | 746 | ) |
diff --git a/crates/ra_assists/src/handlers/unwrap_block.rs b/crates/ra_assists/src/handlers/unwrap_block.rs index b98601f1c..35d87bc9e 100644 --- a/crates/ra_assists/src/handlers/unwrap_block.rs +++ b/crates/ra_assists/src/handlers/unwrap_block.rs | |||
@@ -6,7 +6,7 @@ use ra_syntax::{ast, AstNode}; | |||
6 | 6 | ||
7 | // Assist: unwrap_block | 7 | // Assist: unwrap_block |
8 | // | 8 | // |
9 | // Removes the `mut` keyword. | 9 | // This assist removes if...else, for, while and loop control statements to just keep the body. |
10 | // | 10 | // |
11 | // ``` | 11 | // ``` |
12 | // fn foo() { | 12 | // fn foo() { |
@@ -18,7 +18,7 @@ use ra_syntax::{ast, AstNode}; | |||
18 | // -> | 18 | // -> |
19 | // ``` | 19 | // ``` |
20 | // fn foo() { | 20 | // fn foo() { |
21 | // <|>println!("foo"); | 21 | // println!("foo"); |
22 | // } | 22 | // } |
23 | // ``` | 23 | // ``` |
24 | pub(crate) fn unwrap_block(ctx: AssistCtx) -> Option<Assist> { | 24 | pub(crate) fn unwrap_block(ctx: AssistCtx) -> Option<Assist> { |