Skip to content

Commit 3accaa9

Browse files
committed
Implement Clone using From
This allows using the specialization in clones when it's enabled
1 parent 7a8059e commit 3accaa9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -1563,11 +1563,7 @@ where
15631563
{
15641564
#[inline]
15651565
fn clone(&self) -> SmallVec<A> {
1566-
let mut new_vector = SmallVec::with_capacity(self.len());
1567-
for element in self.iter() {
1568-
new_vector.push((*element).clone())
1569-
}
1570-
new_vector
1566+
SmallVec::from(self.as_slice())
15711567
}
15721568
}
15731569

0 commit comments

Comments
 (0)