@@ -114,7 +114,7 @@ use crate::{
114114#[ derive( Debug , Clone ) ]
115115pub struct Comments < ' a > {
116116 source_text : SourceText < ' a > ,
117- comments : & ' a [ Comment ] ,
117+ inner : & ' a [ Comment ] ,
118118 /// **Critical state field**: Tracks how many comments have been processed.
119119 ///
120120 /// This acts as a cursor dividing the comments array into two sections:
@@ -139,7 +139,7 @@ impl<'a> Comments<'a> {
139139 pub fn new ( source_text : SourceText < ' a > , comments : & ' a [ Comment ] ) -> Self {
140140 Comments {
141141 source_text,
142- comments,
142+ inner : comments,
143143 printed_count : 0 ,
144144 last_handled_type_cast_comment : 0 ,
145145 type_cast_node_span : Span :: default ( ) ,
@@ -150,14 +150,14 @@ impl<'a> Comments<'a> {
150150 /// Returns comments that have not been printed yet.
151151 #[ inline]
152152 pub fn unprinted_comments ( & self ) -> & ' a [ Comment ] {
153- let end = self . view_limit . unwrap_or ( self . comments . len ( ) ) ;
154- & self . comments [ self . printed_count ..end]
153+ let end = self . view_limit . unwrap_or ( self . inner . len ( ) ) ;
154+ & self . inner [ self . printed_count ..end]
155155 }
156156
157157 /// Returns comments that have already been printed.
158158 #[ inline]
159159 pub fn printed_comments ( & self ) -> & ' a [ Comment ] {
160- & self . comments [ ..self . printed_count ]
160+ & self . inner [ ..self . printed_count ]
161161 }
162162
163163 /// Returns an iterator over comments that end before or at the given position.
@@ -458,13 +458,13 @@ impl<'a> Comments<'a> {
458458
459459 // Find the index of the first comment that starts at or after end_pos
460460 // Using binary search would be more efficient for large comment arrays
461- let limit_index = self . comments [ self . printed_count ..]
461+ let limit_index = self . inner [ self . printed_count ..]
462462 . iter ( )
463463 . position ( |c| c. span . start >= end_pos)
464- . map_or ( self . comments . len ( ) , |idx| self . printed_count + idx) ;
464+ . map_or ( self . inner . len ( ) , |idx| self . printed_count + idx) ;
465465
466466 // Only update if we're actually limiting the view
467- if limit_index < self . comments . len ( ) {
467+ if limit_index < self . inner . len ( ) {
468468 self . view_limit = Some ( limit_index) ;
469469 }
470470
0 commit comments