Skip to content

Commit

Permalink
Auto merge of #216 - Alexendoo:clone-slice-from, r=mbrubeck
Browse files Browse the repository at this point in the history
Implement Clone using From

This allows using the specialization in clones when it's enabled
  • Loading branch information
bors-servo authored Apr 25, 2020
2 parents 7a8059e + 3accaa9 commit a541e2d
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,11 +1563,7 @@ where
{
#[inline]
fn clone(&self) -> SmallVec<A> {
let mut new_vector = SmallVec::with_capacity(self.len());
for element in self.iter() {
new_vector.push((*element).clone())
}
new_vector
SmallVec::from(self.as_slice())
}
}

Expand Down

0 comments on commit a541e2d

Please sign in to comment.