Skip to content

Commit 8dd0b7d

Browse files
committed
Assist target should point at *existing* code
1 parent d4c970d commit 8dd0b7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/assists/src/handlers/unwrap_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()>
8383
_ => return None,
8484
};
8585

86+
let target = block.syntax().text_range();
8687
let unwrapped = unwrap_trivial_block(block);
87-
let target = unwrapped.syntax().text_range();
8888
acc.add(assist_id, assist_label, target, |builder| {
8989
builder.replace(
9090
parent.syntax().text_range(),

0 commit comments

Comments
 (0)