aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/remove_dbg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/remove_dbg.rs')
-rw-r--r--crates/ra_assists/src/remove_dbg.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/remove_dbg.rs b/crates/ra_assists/src/remove_dbg.rs
index 6ea48d909..ae9958f11 100644
--- a/crates/ra_assists/src/remove_dbg.rs
+++ b/crates/ra_assists/src/remove_dbg.rs
@@ -62,15 +62,15 @@ fn is_valid_macrocall(macro_call: &ast::MacroCall, macro_name: &str) -> Option<b
62 let name_ref = path.segment()?.name_ref()?; 62 let name_ref = path.segment()?.name_ref()?;
63 63
64 // Make sure it is actually a dbg-macro call, dbg followed by ! 64 // Make sure it is actually a dbg-macro call, dbg followed by !
65 let excl = path.syntax().next_sibling()?; 65 let excl = path.syntax().next_sibling_or_token()?;
66 66
67 if name_ref.text() != macro_name || excl.kind() != EXCL { 67 if name_ref.text() != macro_name || excl.kind() != EXCL {
68 return None; 68 return None;
69 } 69 }
70 70
71 let node = macro_call.token_tree()?.syntax(); 71 let node = macro_call.token_tree()?.syntax();
72 let first_child = node.first_child()?; 72 let first_child = node.first_child_or_token()?;
73 let last_child = node.last_child()?; 73 let last_child = node.last_child_or_token()?;
74 74
75 match (first_child.kind(), last_child.kind()) { 75 match (first_child.kind(), last_child.kind()) {
76 (L_PAREN, R_PAREN) | (L_BRACK, R_BRACK) | (L_CURLY, R_CURLY) => Some(true), 76 (L_PAREN, R_PAREN) | (L_BRACK, R_BRACK) | (L_CURLY, R_CURLY) => Some(true),