Skip to content

Commit 1d60e85

Browse files
committed
refactor(traverse): use ArenaBox alias (#9759)
In transformer, and similar places, our convention is to import `oxc_allocator::Box` as `ArenaBox` and `oxc_allocator::Vec` as `ArenaVec` - to help distinguish between `std`'s `Box` / `Vec`, and their arena-allocated equivalents. Make that change in one place in `oxc_traverse`.
1 parent 225e266 commit 1d60e85

File tree

1 file changed

+3
-3
lines changed
  • crates/oxc_traverse/src/context

1 file changed

+3
-3
lines changed

crates/oxc_traverse/src/context/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use oxc_allocator::{Allocator, Box, Vec as ArenaVec};
1+
use oxc_allocator::{Allocator, Box as ArenaBox, Vec as ArenaVec};
22
use oxc_ast::{
33
AstBuilder,
44
ast::{Expression, IdentifierReference, Statement},
@@ -122,11 +122,11 @@ pub struct TraverseCtx<'a> {
122122
impl<'a> TraverseCtx<'a> {
123123
/// Allocate a node in the arena.
124124
///
125-
/// Returns a [`Box<T>`].
125+
/// Returns a [`Box<'a, T>`](ArenaBox).
126126
///
127127
/// Shortcut for `ctx.ast.alloc`.
128128
#[inline]
129-
pub fn alloc<T>(&self, node: T) -> Box<'a, T> {
129+
pub fn alloc<T>(&self, node: T) -> ArenaBox<'a, T> {
130130
self.ast.alloc(node)
131131
}
132132

0 commit comments

Comments
 (0)