Skip to content

Commit

Permalink
refactor(ast): AstBuilder::vec1 use Vec::from_array_in
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 17, 2024
1 parent 94f3e0a commit cff2b8a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/oxc_ast/src/ast_builder_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ impl<'a> AstBuilder<'a> {
/// Create a new arena-allocated [`Vec`] initialized with a single element.
#[inline]
pub fn vec1<T>(self, value: T) -> Vec<'a, T> {
let mut vec = self.vec_with_capacity(1);
vec.push(value);
vec
self.vec_from_array([value])
}

/// Collect an iterator into a new arena-allocated [`Vec`].
Expand Down

0 comments on commit cff2b8a

Please sign in to comment.