From 47bc36832cb2ea16a3806035be2391c9feef7a9a Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:32:01 +0000 Subject: [PATCH] refactor(traverse): `BoundIdentifier` methods only take `&TraverseCtx` (#6811) These methods don't require a `&mut TraverseCtx`, as they only call methods on `AstBuilder`. --- crates/oxc_traverse/src/context/bound_identifier.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/oxc_traverse/src/context/bound_identifier.rs b/crates/oxc_traverse/src/context/bound_identifier.rs index ad1bc56160c38..c23bce08581ca 100644 --- a/crates/oxc_traverse/src/context/bound_identifier.rs +++ b/crates/oxc_traverse/src/context/bound_identifier.rs @@ -47,12 +47,12 @@ impl<'a> BoundIdentifier<'a> { } /// Create `BindingIdentifier` for this binding - pub fn create_binding_identifier(&self, ctx: &mut TraverseCtx<'a>) -> BindingIdentifier<'a> { + pub fn create_binding_identifier(&self, ctx: &TraverseCtx<'a>) -> BindingIdentifier<'a> { ctx.ast.binding_identifier_with_symbol_id(SPAN, self.name.clone(), self.symbol_id) } /// Create `BindingPattern` for this binding - pub fn create_binding_pattern(&self, ctx: &mut TraverseCtx<'a>) -> BindingPattern<'a> { + pub fn create_binding_pattern(&self, ctx: &TraverseCtx<'a>) -> BindingPattern<'a> { let ident = self.create_binding_identifier(ctx); let binding_pattern_kind = ctx.ast.binding_pattern_kind_from_binding_identifier(ident); ctx.ast.binding_pattern(binding_pattern_kind, NONE, false)