Skip to content

Commit

Permalink
refactor: simplify conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Jul 20, 2024
1 parent 859e629 commit 3f9105a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions matching/src/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ impl Matches for CSTNode<'_> {
left.get_identifier() == right.get_identifier()
}
(CSTNode::NonTerminal(left), CSTNode::NonTerminal(right)) => {
if let (Some(left_identifier), Some(right_identifier)) =
(left.get_identifier(), right.get_identifier())
{
left_identifier == right_identifier
} else {
left.kind == right.kind
}
left.kind == right.kind && left.get_identifier() == right.get_identifier()
}
(_, _) => false,
}
Expand Down

0 comments on commit 3f9105a

Please sign in to comment.