Merge pull request #1385 from tree-sitter/feat/rust-query-match-id

feat(rust): Add an id() method for QueryMatch
This commit is contained in:
Max Brunsfeld 2021-09-14 09:35:59 -07:00 committed by GitHub
commit 80a2526843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1753,6 +1753,10 @@ impl QueryCursor {
}
impl<'a, 'tree> QueryMatch<'a, 'tree> {
pub fn id(&self) -> u32 {
self.id
}
pub fn remove(self) {
unsafe { ffi::ts_query_cursor_remove_match(self.cursor, self.id) }
}