diff options
author | Aleksey Kladov <[email protected]> | 2020-03-18 19:51:47 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-18 19:51:47 +0000 |
commit | 0bf903411c6bf94a235383b2d60988ceee58ea90 (patch) | |
tree | 26fa8907363441be33736e891dded863a433f898 /crates/ra_syntax/src | |
parent | b28d41186698a6e2aa3d679ee63dd48304ca4262 (diff) |
Use match_ast
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index e3f74da6d..cef926ed3 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -179,10 +179,10 @@ macro_rules! match_ast { | |||
179 | (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) }; | 179 | (match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) }; |
180 | 180 | ||
181 | (match ($node:expr) { | 181 | (match ($node:expr) { |
182 | $( ast::$ast:ident($it:ident) => $res:block, )* | 182 | $( ast::$ast:ident($it:ident) => $res:expr, )* |
183 | _ => $catch_all:expr $(,)? | 183 | _ => $catch_all:expr $(,)? |
184 | }) => {{ | 184 | }) => {{ |
185 | $( if let Some($it) = ast::$ast::cast($node.clone()) $res else )* | 185 | $( if let Some($it) = ast::$ast::cast($node.clone()) { $res } else )* |
186 | { $catch_all } | 186 | { $catch_all } |
187 | }}; | 187 | }}; |
188 | } | 188 | } |