Skip to content

Commit 28221f3

Browse files
author
bors-servo
authored
Auto merge of #30 - Marwes:default, r=jdm
Implement Default for SmallVec <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/30) <!-- Reviewable:end -->
2 parents a48ec67 + 4e754ee commit 28221f3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,13 @@ impl<A: Array> SmallVec<A> {
455455
}
456456
}
457457

458+
impl<A: Array> Default for SmallVec<A> {
459+
#[inline]
460+
fn default() -> SmallVec<A> {
461+
SmallVec::new()
462+
}
463+
}
464+
458465
impl<A: Array> Drop for SmallVec<A> {
459466
fn drop(&mut self) {
460467
// Note on panic safety: dropping an element may panic,

0 commit comments

Comments
 (0)