Skip to content

Commit

Permalink
refactor(traverse): BoundIdentifier methods only take &TraverseCtx (
Browse files Browse the repository at this point in the history
#6811)

These methods don't require a `&mut TraverseCtx`, as they only call methods on `AstBuilder`.
  • Loading branch information
overlookmotel committed Oct 23, 2024
1 parent 55c07f2 commit 47bc368
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_traverse/src/context/bound_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 47bc368

Please sign in to comment.