From 8dd0b7d2b59cffda0aa788c5d3016fe75d31a2ff Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 17 Nov 2020 14:00:52 +0100 Subject: Assist target should point at *existing* code --- crates/assists/src/handlers/unwrap_block.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/assists/src/handlers/unwrap_block.rs b/crates/assists/src/handlers/unwrap_block.rs index 36ef871b9..a82399aa8 100644 --- a/crates/assists/src/handlers/unwrap_block.rs +++ b/crates/assists/src/handlers/unwrap_block.rs @@ -83,8 +83,8 @@ pub(crate) fn unwrap_block(acc: &mut Assists, ctx: &AssistContext) -> Option<()> _ => return None, }; + let target = block.syntax().text_range(); let unwrapped = unwrap_trivial_block(block); - let target = unwrapped.syntax().text_range(); acc.add(assist_id, assist_label, target, |builder| { builder.replace( parent.syntax().text_range(), -- cgit v1.2.3