aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r--crates/ra_assists/src/handlers/unwrap_block.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/unwrap_block.rs b/crates/ra_assists/src/handlers/unwrap_block.rs
index 8912ce645..58649c47e 100644
--- a/crates/ra_assists/src/handlers/unwrap_block.rs
+++ b/crates/ra_assists/src/handlers/unwrap_block.rs
@@ -76,12 +76,11 @@ pub(crate) fn unwrap_block(ctx: AssistCtx) -> Option<Assist> {
76 }) 76 })
77} 77}
78 78
79fn extract_expr(cursor_range: TextRange, block_expr: BlockExpr) -> Option<Expr> { 79fn extract_expr(cursor_range: TextRange, block: BlockExpr) -> Option<Expr> {
80 let block = block_expr.block()?;
81 let cursor_in_range = block.l_curly_token()?.text_range().contains_range(cursor_range); 80 let cursor_in_range = block.l_curly_token()?.text_range().contains_range(cursor_range);
82 81
83 if cursor_in_range { 82 if cursor_in_range {
84 Some(unwrap_trivial_block(block_expr)) 83 Some(unwrap_trivial_block(block))
85 } else { 84 } else {
86 None 85 None
87 } 86 }