Skip to content

Commit 4fa914c

Browse files
committed
refactor(transformer): elide lifetimes where possible
1 parent b8d26ea commit 4fa914c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+100
-103
lines changed

crates/oxc_transformer/src/common/arrow_function_converter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub struct ArrowFunctionConverter<'a> {
146146
super_methods: Option<FxIndexMap<SuperMethodKey<'a>, SuperMethodInfo<'a>>>,
147147
}
148148

149-
impl<'a> ArrowFunctionConverter<'a> {
149+
impl ArrowFunctionConverter<'_> {
150150
pub fn new(env: &EnvOptions) -> Self {
151151
let mode = if env.es2015.arrow_function.is_some() {
152152
ArrowFunctionConverterMode::Enabled

crates/oxc_transformer/src/common/helper_loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub struct HelperLoaderStore<'a> {
206206
pub(crate) used_helpers: RefCell<FxHashMap<Helper, String>>,
207207
}
208208

209-
impl<'a> HelperLoaderStore<'a> {
209+
impl HelperLoaderStore<'_> {
210210
pub fn new(options: &HelperLoaderOptions) -> Self {
211211
Self {
212212
module_name: options.module_name.clone(),

crates/oxc_transformer/src/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<'a, 'ctx> Common<'a, 'ctx> {
4040
}
4141
}
4242

43-
impl<'a, 'ctx> Traverse<'a> for Common<'a, 'ctx> {
43+
impl<'a> Traverse<'a> for Common<'a, '_> {
4444
fn exit_program(&mut self, program: &mut Program<'a>, ctx: &mut TraverseCtx<'a>) {
4545
self.module_imports.exit_program(program, ctx);
4646
self.var_declarations.exit_program(program, ctx);

crates/oxc_transformer/src/common/module_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a, 'ctx> ModuleImports<'a, 'ctx> {
5454
}
5555
}
5656

57-
impl<'a, 'ctx> Traverse<'a> for ModuleImports<'a, 'ctx> {
57+
impl<'a> Traverse<'a> for ModuleImports<'a, '_> {
5858
fn exit_program(&mut self, _program: &mut Program<'a>, ctx: &mut TraverseCtx<'a>) {
5959
self.ctx.module_imports.insert_into_program(self.ctx, ctx);
6060
}

crates/oxc_transformer/src/common/statement_injector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'a, 'ctx> StatementInjector<'a, 'ctx> {
3333
}
3434
}
3535

36-
impl<'a, 'ctx> Traverse<'a> for StatementInjector<'a, 'ctx> {
36+
impl<'a> Traverse<'a> for StatementInjector<'a, '_> {
3737
fn exit_statements(
3838
&mut self,
3939
statements: &mut ArenaVec<'a, Statement<'a>>,
@@ -61,7 +61,7 @@ pub struct StatementInjectorStore<'a> {
6161
}
6262

6363
// Public methods
64-
impl<'a> StatementInjectorStore<'a> {
64+
impl StatementInjectorStore<'_> {
6565
/// Create new `StatementInjectorStore`.
6666
pub fn new() -> Self {
6767
Self { insertions: RefCell::new(FxHashMap::default()) }

crates/oxc_transformer/src/common/top_level_statements.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'a, 'ctx> TopLevelStatements<'a, 'ctx> {
3333
}
3434
}
3535

36-
impl<'a, 'ctx> Traverse<'a> for TopLevelStatements<'a, 'ctx> {
36+
impl<'a> Traverse<'a> for TopLevelStatements<'a, '_> {
3737
fn exit_program(&mut self, program: &mut Program<'a>, _ctx: &mut TraverseCtx<'a>) {
3838
self.ctx.top_level_statements.insert_into_program(program);
3939
}

crates/oxc_transformer/src/common/var_declarations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<'a, 'ctx> VarDeclarations<'a, 'ctx> {
4040
}
4141
}
4242

43-
impl<'a, 'ctx> Traverse<'a> for VarDeclarations<'a, 'ctx> {
43+
impl<'a> Traverse<'a> for VarDeclarations<'a, '_> {
4444
fn enter_statements(
4545
&mut self,
4646
_stmts: &mut ArenaVec<'a, Statement<'a>>,

crates/oxc_transformer/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct TransformCtx<'a> {
4646
pub top_level_statements: TopLevelStatementsStore<'a>,
4747
}
4848

49-
impl<'a> TransformCtx<'a> {
49+
impl TransformCtx<'_> {
5050
pub fn new(source_path: &Path, options: &TransformOptions) -> Self {
5151
let filename = source_path
5252
.file_stem() // omit file extension

crates/oxc_transformer/src/es2015/arrow_functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ impl<'a, 'ctx> ArrowFunctions<'a, 'ctx> {
152152
}
153153
}
154154

155-
impl<'a, 'ctx> Traverse<'a> for ArrowFunctions<'a, 'ctx> {}
155+
impl<'a> Traverse<'a> for ArrowFunctions<'a, '_> {}

crates/oxc_transformer/src/es2015/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ impl<'a, 'ctx> ES2015<'a, 'ctx> {
2626
}
2727
}
2828

29-
impl<'a, 'ctx> Traverse<'a> for ES2015<'a, 'ctx> {}
29+
impl<'a> Traverse<'a> for ES2015<'a, '_> {}

0 commit comments

Comments
 (0)