Skip to content

Commit

Permalink
refactor(transformer/jsx): return &mut T not &mut ArenaBox<T> (#7001
Browse files Browse the repository at this point in the history
)

`&mut ArenaBox<T>` is a double-reference. `&mut T` is shorter and easier to read.
  • Loading branch information
overlookmotel committed Oct 29, 2024
1 parent ae22671 commit e5ecbb9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/oxc_transformer/src/jsx/display_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
//!
//! * Babel plugin implementation: <https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-react-display-name/src/index.ts>

use oxc_allocator::Box as ArenaBox;
use oxc_ast::ast::*;
use oxc_span::{Atom, SPAN};
use oxc_traverse::{Ancestor, Traverse, TraverseCtx};
Expand Down Expand Up @@ -133,7 +132,7 @@ impl<'a, 'ctx> ReactDisplayName<'a, 'ctx> {
/// Get the object from `React.createClass({})` or `createReactClass({})`
fn get_object_from_create_class<'b>(
call_expr: &'b mut CallExpression<'a>,
) -> Option<&'b mut ArenaBox<'a, ObjectExpression<'a>>> {
) -> Option<&'b mut ObjectExpression<'a>> {
if match &call_expr.callee {
callee @ match_member_expression!(Expression) => {
!callee.to_member_expression().is_specific_member_access("React", "createClass")
Expand Down

0 comments on commit e5ecbb9

Please sign in to comment.