Skip to content

Commit

Permalink
Implement Clone using From
Browse files Browse the repository at this point in the history
This allows using the specialization in clones when it's enabled
  • Loading branch information
Alexendoo committed Apr 25, 2020
1 parent 7a8059e commit 3accaa9
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 3accaa9

Please sign in to comment.