From 0d31b989c00b063287f502b4f846a369ec50138c Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sat, 14 Dec 2024 01:02:44 +0000 Subject: [PATCH] refactor(semantic)!: remove `SymbolTable::rename` method --- crates/oxc_semantic/src/symbol.rs | 5 ----- .../oxc_transformer/src/common/arrow_function_converter.rs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/oxc_semantic/src/symbol.rs b/crates/oxc_semantic/src/symbol.rs index 2ef0a176be4fc8..42fda763edf2ae 100644 --- a/crates/oxc_semantic/src/symbol.rs +++ b/crates/oxc_semantic/src/symbol.rs @@ -101,11 +101,6 @@ impl SymbolTable { } /// Rename a symbol. - #[inline] - pub fn rename(&mut self, symbol_id: SymbolId, new_name: CompactStr) { - self.names[symbol_id] = new_name; - } - #[inline] pub fn set_name(&mut self, symbol_id: SymbolId, name: CompactStr) { self.names[symbol_id] = name; diff --git a/crates/oxc_transformer/src/common/arrow_function_converter.rs b/crates/oxc_transformer/src/common/arrow_function_converter.rs index 75d30d3ac47d64..2d528719ba9606 100644 --- a/crates/oxc_transformer/src/common/arrow_function_converter.rs +++ b/crates/oxc_transformer/src/common/arrow_function_converter.rs @@ -905,7 +905,7 @@ impl<'a> ArrowFunctionConverter<'a> { /// Rename the `arguments` symbol to a new name. fn rename_arguments_symbol(symbol_id: SymbolId, name: CompactStr, ctx: &mut TraverseCtx<'a>) { let scope_id = ctx.symbols().get_scope_id(symbol_id); - ctx.symbols_mut().rename(symbol_id, name.clone()); + ctx.symbols_mut().set_name(symbol_id, name.clone()); ctx.scopes_mut().rename_binding(scope_id, "arguments", name); }