single_match

This commit is contained in:
Johann Hemmann 2024-01-19 18:31:15 +01:00
parent 9dd07f0bc4
commit b1a0c9ac40
14 changed files with 89 additions and 130 deletions

View file

@ -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)) => {