@@ -196,7 +196,7 @@ impl<'a> Position<'a> {
196
196
self . inner . downgrade ( )
197
197
}
198
198
199
- pub fn inner_node ( & self ) -> & Node {
199
+ pub fn inner_node ( & self ) -> & Node < ' a > {
200
200
& self . inner . node
201
201
}
202
202
@@ -520,7 +520,7 @@ impl<'a> Range<'a> {
520
520
Self { node, start, end }
521
521
}
522
522
523
- pub fn node ( & self ) -> & Node {
523
+ pub fn node ( & self ) -> & Node < ' a > {
524
524
& self . node
525
525
}
526
526
@@ -913,7 +913,7 @@ impl<'a> Node<'a> {
913
913
}
914
914
}
915
915
916
- pub fn document_range ( & self ) -> Range {
916
+ pub fn document_range ( & self ) -> Range < ' _ > {
917
917
let start = self . document_start ( ) ;
918
918
let end = self . document_end ( ) ;
919
919
Range :: new ( * self , start, end)
@@ -923,15 +923,15 @@ impl<'a> Node<'a> {
923
923
self . data ( ) . text_selection ( ) . is_some ( )
924
924
}
925
925
926
- pub fn text_selection ( & self ) -> Option < Range > {
926
+ pub fn text_selection ( & self ) -> Option < Range < ' _ > > {
927
927
self . data ( ) . text_selection ( ) . map ( |selection| {
928
928
let anchor = InnerPosition :: clamped_upgrade ( self . tree_state , selection. anchor ) . unwrap ( ) ;
929
929
let focus = InnerPosition :: clamped_upgrade ( self . tree_state , selection. focus ) . unwrap ( ) ;
930
930
Range :: new ( * self , anchor, focus)
931
931
} )
932
932
}
933
933
934
- pub fn text_selection_anchor ( & self ) -> Option < Position > {
934
+ pub fn text_selection_anchor ( & self ) -> Option < Position < ' _ > > {
935
935
self . data ( ) . text_selection ( ) . map ( |selection| {
936
936
let anchor = InnerPosition :: clamped_upgrade ( self . tree_state , selection. anchor ) . unwrap ( ) ;
937
937
Position {
@@ -941,7 +941,7 @@ impl<'a> Node<'a> {
941
941
} )
942
942
}
943
943
944
- pub fn text_selection_focus ( & self ) -> Option < Position > {
944
+ pub fn text_selection_focus ( & self ) -> Option < Position < ' _ > > {
945
945
self . data ( ) . text_selection ( ) . map ( |selection| {
946
946
let focus = InnerPosition :: clamped_upgrade ( self . tree_state , selection. focus ) . unwrap ( ) ;
947
947
Position {
@@ -953,7 +953,7 @@ impl<'a> Node<'a> {
953
953
954
954
/// Returns the nearest text position to the given point
955
955
/// in this node's coordinate space.
956
- pub fn text_position_at_point ( & self , point : Point ) -> Position {
956
+ pub fn text_position_at_point ( & self , point : Point ) -> Position < ' _ > {
957
957
let id = self . id ( ) ;
958
958
if let Some ( ( node, point) ) = self . hit_test ( point, & move |node| text_node_filter ( id, node) ) {
959
959
if node. role ( ) == Role :: TextRun {
@@ -1022,7 +1022,7 @@ impl<'a> Node<'a> {
1022
1022
}
1023
1023
}
1024
1024
1025
- pub fn line_range_from_index ( & self , line_index : usize ) -> Option < Range > {
1025
+ pub fn line_range_from_index ( & self , line_index : usize ) -> Option < Range < ' _ > > {
1026
1026
let mut pos = self . document_range ( ) . start ( ) ;
1027
1027
1028
1028
if line_index > 0 {
@@ -1045,7 +1045,7 @@ impl<'a> Node<'a> {
1045
1045
Some ( Range :: new ( * self , pos. inner , end. inner ) )
1046
1046
}
1047
1047
1048
- pub fn text_position_from_global_usv_index ( & self , index : usize ) -> Option < Position > {
1048
+ pub fn text_position_from_global_usv_index ( & self , index : usize ) -> Option < Position < ' _ > > {
1049
1049
let mut total_length = 0usize ;
1050
1050
for node in self . text_runs ( ) {
1051
1051
let node_text = node. data ( ) . value ( ) . unwrap ( ) ;
@@ -1087,7 +1087,7 @@ impl<'a> Node<'a> {
1087
1087
None
1088
1088
}
1089
1089
1090
- pub fn text_position_from_global_utf16_index ( & self , index : usize ) -> Option < Position > {
1090
+ pub fn text_position_from_global_utf16_index ( & self , index : usize ) -> Option < Position < ' _ > > {
1091
1091
let mut total_length = 0usize ;
1092
1092
for node in self . text_runs ( ) {
1093
1093
let node_text = node. data ( ) . value ( ) . unwrap ( ) ;
0 commit comments