aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/unwrap_block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/handlers/unwrap_block.rs')
-rw-r--r--crates/ra_assists/src/handlers/unwrap_block.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/unwrap_block.rs b/crates/ra_assists/src/handlers/unwrap_block.rs
index 859c70ad8..6df927abb 100644
--- a/crates/ra_assists/src/handlers/unwrap_block.rs
+++ b/crates/ra_assists/src/handlers/unwrap_block.rs
@@ -57,9 +57,9 @@ pub(crate) fn unwrap_block(ctx: AssistCtx) -> Option<Assist> {
57 } 57 }
58 }; 58 };
59 59
60 ctx.add_assist(AssistId("unwrap_block"), "Unwrap block", |edit| { 60 let target = expr_to_unwrap.syntax().text_range();
61 ctx.add_assist(AssistId("unwrap_block"), "Unwrap block", target, |edit| {
61 edit.set_cursor(expr.syntax().text_range().start()); 62 edit.set_cursor(expr.syntax().text_range().start());
62 edit.target(expr_to_unwrap.syntax().text_range());
63 63
64 let pat_start: &[_] = &[' ', '{', '\n']; 64 let pat_start: &[_] = &[' ', '{', '\n'];
65 let expr_to_unwrap = expr_to_unwrap.to_string(); 65 let expr_to_unwrap = expr_to_unwrap.to_string();
@@ -89,7 +89,7 @@ fn extract_expr(cursor_range: TextRange, block: ast::BlockExpr) -> Option<ast::E
89 89
90#[cfg(test)] 90#[cfg(test)]
91mod tests { 91mod tests {
92 use crate::helpers::{check_assist, check_assist_not_applicable}; 92 use crate::tests::{check_assist, check_assist_not_applicable};
93 93
94 use super::*; 94 use super::*;
95 95