From cbcb51b8575ca58f8bfde4f5e78cd08d562faa81 Mon Sep 17 00:00:00 2001 From: Will Lillis Date: Tue, 9 Apr 2024 12:19:06 -0400 Subject: [PATCH] fix: tie the lifetime of the cursor to the query in `QueryCursor::captures()` --- lib/binding_rust/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/binding_rust/lib.rs b/lib/binding_rust/lib.rs index 420f82e4..45626c14 100644 --- a/lib/binding_rust/lib.rs +++ b/lib/binding_rust/lib.rs @@ -2359,8 +2359,8 @@ impl QueryCursor { /// This is useful if you don't care about which pattern matched, and just want a single, /// ordered sequence of captures. #[doc(alias = "ts_query_cursor_exec")] - pub fn captures<'query, 'tree, T: TextProvider, I: AsRef<[u8]>>( - &mut self, + pub fn captures<'query, 'cursor: 'query, 'tree, T: TextProvider, I: AsRef<[u8]>>( + &'cursor mut self, query: &'query Query, node: Node<'tree>, text_provider: T,