mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(transformer/async-to-generator): remove unused &self function param (#7166)
Follow-on after stack up to #7148. Remove unused `&self` function param. This makes calling this function slightly cheaper, as unused data doesn't get passed to the function.
This commit is contained in:
parent
217d433eb8
commit
b57d5a5277
1 changed files with 1 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ impl<'a, 'ctx> Traverse<'a> for AsyncToGenerator<'a, 'ctx> {
|
||||||
fn exit_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) {
|
fn exit_expression(&mut self, expr: &mut Expression<'a>, ctx: &mut TraverseCtx<'a>) {
|
||||||
let new_expr = match expr {
|
let new_expr = match expr {
|
||||||
Expression::AwaitExpression(await_expr) => {
|
Expression::AwaitExpression(await_expr) => {
|
||||||
self.transform_await_expression(await_expr, ctx)
|
Self::transform_await_expression(await_expr, ctx)
|
||||||
}
|
}
|
||||||
Expression::FunctionExpression(func) => {
|
Expression::FunctionExpression(func) => {
|
||||||
if func.r#async && !func.generator && !func.is_typescript_syntax() {
|
if func.r#async && !func.generator && !func.is_typescript_syntax() {
|
||||||
|
|
@ -166,9 +166,7 @@ impl<'a, 'ctx> AsyncToGenerator<'a, 'ctx> {
|
||||||
|
|
||||||
/// Transforms `await` expressions to `yield` expressions.
|
/// Transforms `await` expressions to `yield` expressions.
|
||||||
/// Ignores top-level await expressions.
|
/// Ignores top-level await expressions.
|
||||||
#[allow(clippy::unused_self)]
|
|
||||||
fn transform_await_expression(
|
fn transform_await_expression(
|
||||||
&self,
|
|
||||||
expr: &mut AwaitExpression<'a>,
|
expr: &mut AwaitExpression<'a>,
|
||||||
ctx: &mut TraverseCtx<'a>,
|
ctx: &mut TraverseCtx<'a>,
|
||||||
) -> Option<Expression<'a>> {
|
) -> Option<Expression<'a>> {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue