diff options
Diffstat (limited to 'crates/ra_assists/src/handlers/remove_dbg.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/remove_dbg.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_assists/src/handlers/remove_dbg.rs b/crates/ra_assists/src/handlers/remove_dbg.rs index 5085649b4..4e5eb4350 100644 --- a/crates/ra_assists/src/handlers/remove_dbg.rs +++ b/crates/ra_assists/src/handlers/remove_dbg.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | ast::{self, AstNode}, | 2 | ast::{self, AstNode}, |
3 | TextUnit, T, | 3 | TextSize, T, |
4 | }; | 4 | }; |
5 | 5 | ||
6 | use crate::{Assist, AssistCtx, AssistId}; | 6 | use crate::{Assist, AssistCtx, AssistId}; |
@@ -38,9 +38,9 @@ pub(crate) fn remove_dbg(ctx: AssistCtx) -> Option<Assist> { | |||
38 | let offset_start = file_range | 38 | let offset_start = file_range |
39 | .start() | 39 | .start() |
40 | .checked_sub(macro_range.start()) | 40 | .checked_sub(macro_range.start()) |
41 | .unwrap_or_else(|| TextUnit::from(0)); | 41 | .unwrap_or_else(|| TextSize::from(0)); |
42 | 42 | ||
43 | let dbg_size = TextUnit::of_str("dbg!("); | 43 | let dbg_size = TextSize::of("dbg!("); |
44 | 44 | ||
45 | if offset_start > dbg_size { | 45 | if offset_start > dbg_size { |
46 | file_range.start() - dbg_size | 46 | file_range.start() - dbg_size |
@@ -53,7 +53,7 @@ pub(crate) fn remove_dbg(ctx: AssistCtx) -> Option<Assist> { | |||
53 | let macro_args = macro_call.token_tree()?.syntax().clone(); | 53 | let macro_args = macro_call.token_tree()?.syntax().clone(); |
54 | 54 | ||
55 | let text = macro_args.text(); | 55 | let text = macro_args.text(); |
56 | let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); | 56 | let without_parens = TextSize::of('(')..text.len() - TextSize::of(')'); |
57 | text.slice(without_parens).to_string() | 57 | text.slice(without_parens).to_string() |
58 | }; | 58 | }; |
59 | 59 | ||