From c41c013b4d424156bd2d01dcc9302bfe720665bf Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sat, 26 Oct 2024 12:57:41 +0000 Subject: [PATCH] refactor(ast): rename lifetime (#6922) Rename lifetime to make clear it's for a temporary borrow, and not lifetime of the arena (which is what we conventionally use `'a` for). --- crates/oxc_ast/src/trivia.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 = {