Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions crates/oxc_allocator/src/vec2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2067,26 +2067,6 @@ impl<'a, T: 'a + PartialEq, A: Alloc> Vec<'a, T, A> {
// Common trait implementations for Vec
////////////////////////////////////////////////////////////////////////////////

impl<'a, T: 'a + Clone, A: Alloc> Clone for Vec<'a, T, A> {
#[cfg(not(test))]
fn clone(&self) -> Vec<'a, T, A> {
let mut v = Vec::with_capacity_in(self.len_usize(), self.buf.bump());
v.extend(self.iter().cloned());
v
}

// HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
// required for this method definition, is not available. Instead use the
// `slice::to_vec` function which is only available with cfg(test)
// NB see the slice::hack module in slice.rs for more information
#[cfg(test)]
fn clone(&self) -> Vec<'a, T, A> {
let mut v = Vec::new_in(self.buf.bump());
v.extend(self.iter().cloned());
v
}
}

impl<'a, T: 'a + Hash, A: Alloc> Hash for Vec<'a, T, A> {
#[inline]
fn hash<H: hash::Hasher>(&self, state: &mut H) {
Expand Down
Loading