@@ -674,11 +674,11 @@ impl<'ts_query> TsQuery<'ts_query> {
674
674
}
675
675
676
676
/// Run the query on `contents` and collect all captures as (capture_name, node) pairs
677
- pub ( crate ) fn all_captures < ' tree , ' query > (
677
+ pub ( crate ) fn all_captures < ' tree , ' query , ' contents > (
678
678
& ' query mut self ,
679
679
node : tree_sitter:: Node < ' tree > ,
680
- contents : & ' query [ u8 ] ,
681
- ) -> AllCaptures < ' tree , ' query >
680
+ contents : & ' contents [ u8 ] ,
681
+ ) -> AllCaptures < ' tree , ' query , ' contents >
682
682
where
683
683
' tree : ' query ,
684
684
{
@@ -739,16 +739,16 @@ impl<'ts_query> TsQuery<'ts_query> {
739
739
}
740
740
}
741
741
742
- pub ( crate ) struct AllCaptures < ' tree , ' query > {
742
+ pub ( crate ) struct AllCaptures < ' tree , ' query , ' contents > {
743
743
query : & ' query tree_sitter:: Query ,
744
- matches_iter : tree_sitter:: QueryMatches < ' query , ' tree , & ' query [ u8 ] , & ' query [ u8 ] > ,
744
+ matches_iter : tree_sitter:: QueryMatches < ' query , ' tree , & ' contents [ u8 ] , & ' contents [ u8 ] > ,
745
745
current_captures_iter : Option < std:: slice:: Iter < ' query , tree_sitter:: QueryCapture < ' tree > > > ,
746
746
}
747
747
748
- impl < ' tree , ' query > AllCaptures < ' tree , ' query > {
748
+ impl < ' tree , ' query , ' contents > AllCaptures < ' tree , ' query , ' contents > {
749
749
pub ( crate ) fn new (
750
750
query : & ' query tree_sitter:: Query ,
751
- matches_iter : tree_sitter:: QueryMatches < ' query , ' tree , & ' query [ u8 ] , & ' query [ u8 ] > ,
751
+ matches_iter : tree_sitter:: QueryMatches < ' query , ' tree , & ' contents [ u8 ] , & ' contents [ u8 ] > ,
752
752
) -> Self {
753
753
Self {
754
754
query,
@@ -758,7 +758,7 @@ impl<'tree, 'query> AllCaptures<'tree, 'query> {
758
758
}
759
759
}
760
760
761
- impl < ' tree , ' query > Iterator for AllCaptures < ' tree , ' query > {
761
+ impl < ' tree , ' query , ' contents > Iterator for AllCaptures < ' tree , ' query , ' contents > {
762
762
type Item = ( String , tree_sitter:: Node < ' tree > ) ;
763
763
764
764
// The iterator yields `(capture_name, node)` pairs by walking through all query matches.
0 commit comments