aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/remove_dbg.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-03-30 10:25:53 +0000
committerAleksey Kladov <[email protected]>2019-04-01 10:06:24 +0100
commit9e213385c9d06db3c8ca20812779e2b8f8ad2c71 (patch)
treefe57697b54ccfb791fe96c13cb553a8570516270 /crates/ra_assists/src/remove_dbg.rs
parentdec9bde10868b5e459535449476d17a6a0987b3e (diff)
switch to new rowan
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),