mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
refactor(ast/builder): use Box::new_in over .into_in (#4428)
In `AstBuilder`'s `alloc_*` methods, use `Box::new_in` instead of `.into_in`. This is more explicit, so I feel easier to understand. It may also make life easier for compiler by not requiring it to perform type coercion.
This commit is contained in:
parent
46cf7179a4
commit
9c5d2f9d6a
2 changed files with 377 additions and 283 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -277,7 +277,7 @@ fn generate_struct_builder_fn(ty: &RStruct, ctx: &CodegenCtx) -> TokenStream {
|
|||
endl!();
|
||||
#[inline]
|
||||
pub fn #alloc_fn_name #generic_params (self, #(#params),*) -> Box<'a, #as_type> #where_clause {
|
||||
self.#fn_name(#(#args),*).into_in(self.allocator)
|
||||
Box::new_in(self.#fn_name(#(#args),*), self.allocator)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue