Skip to content

Commit 06c5455

Browse files
committed
feat: impelment PartialEq and Eq for tree_sitter::Node
1 parent 5dba7fb commit 06c5455

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

crates/postgresql-cst-parser/src/tree_sitter.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ pub struct Node<'a> {
6363
pub node_or_token: NodeOrToken<'a>,
6464
}
6565

66+
impl<'a> PartialEq for Node<'a> {
67+
fn eq(&self, other: &Self) -> bool {
68+
self.node_or_token == other.node_or_token
69+
}
70+
}
71+
72+
impl<'a> Eq for Node<'a> {}
73+
6674
#[derive(Debug, Clone)]
6775
pub struct TreeCursor<'a> {
6876
pub input: &'a str,

0 commit comments

Comments
 (0)