Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 307812156e..3607c486d7 100644 --- a/crates/ide/src/syntax_highlighting.rs +++ b/crates/ide/src/syntax_highlighting.rs @@ -282,8 +282,8 @@ fn traverse( inside_attribute = false } - Enter(NodeOrToken::Node(node)) => match ast::Item::cast(node.clone()) { - Some(item) => { + Enter(NodeOrToken::Node(node)) => { + if let Some(item) = ast::Item::cast(node.clone()) { match item { ast::Item::MacroRules(mac) => { macro_highlighter.init(); @@ -324,8 +324,7 @@ fn traverse( } } } - _ => (), - }, + } Leave(NodeOrToken::Node(node)) if ast::Item::can_cast(node.kind()) => { match ast::Item::cast(node.clone()) { Some(ast::Item::MacroRules(mac)) => { |