From bbe22640b8d52354c3de3e126c9fcda5b1b174fd Mon Sep 17 00:00:00 2001 From: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:53:47 +0200 Subject: Add unwrap block assist #4156 Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> --- crates/ra_assists/src/doc_tests/generated.rs | 2 +- crates/ra_assists/src/handlers/unwrap_block.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') 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() { "#####, r#####" fn foo() { - <|>println!("foo"); + println!("foo"); } "#####, ) 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}; // Assist: unwrap_block // -// Removes the `mut` keyword. +// This assist removes if...else, for, while and loop control statements to just keep the body. // // ``` // fn foo() { @@ -18,7 +18,7 @@ use ra_syntax::{ast, AstNode}; // -> // ``` // fn foo() { -// <|>println!("foo"); +// println!("foo"); // } // ``` pub(crate) fn unwrap_block(ctx: AssistCtx) -> Option { -- cgit v1.2.3