aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists')
-rw-r--r--crates/ra_assists/src/remove_dbg.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_assists/src/remove_dbg.rs b/crates/ra_assists/src/remove_dbg.rs
index c330bc827..5657ee4b8 100644
--- a/crates/ra_assists/src/remove_dbg.rs
+++ b/crates/ra_assists/src/remove_dbg.rs
@@ -36,11 +36,10 @@ pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist>
36 36
37 let macro_content = { 37 let macro_content = {
38 let macro_args = macro_call.token_tree()?.syntax().clone(); 38 let macro_args = macro_call.token_tree()?.syntax().clone();
39 let range = macro_args.range();
40 let start = range.start() + TextUnit::of_char('(');
41 let end = range.end() - TextUnit::of_char(')');
42 39
43 macro_args.text().slice(start..end).to_string() 40 let text = macro_args.text();
41 let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')');
42 text.slice(without_parens).to_string()
44 }; 43 };
45 44
46 ctx.add_action(AssistId("remove_dbg"), "remove dbg!()", |edit| { 45 ctx.add_action(AssistId("remove_dbg"), "remove dbg!()", |edit| {