diff --git a/crates/oxc_ast/src/trivia.rs b/crates/oxc_ast/src/trivia.rs index 96ef5fc89..5026d229c 100644 --- a/crates/oxc_ast/src/trivia.rs +++ b/crates/oxc_ast/src/trivia.rs @@ -22,15 +22,15 @@ pub fn has_comments_between(comments: &[Comment], span: Span) -> bool { } /// Double-ended iterator over a range of comments, by starting position. -pub struct CommentsRange<'a> { - comments: &'a [Comment], +pub struct CommentsRange<'c> { + comments: &'c [Comment], range: (Bound, Bound), current_start: usize, current_end: usize, } -impl<'a> CommentsRange<'a> { - fn new(comments: &'a [Comment], start: Bound, end: Bound) -> Self { +impl<'c> CommentsRange<'c> { + fn new(comments: &'c [Comment], start: Bound, end: Bound) -> Self { // Directly skip all comments that are already known to start // outside the requested range. let partition_start = {