Skip to content

Commit 918e573

Browse files
author
bors-servo
authored
Auto merge of #39 - servo:new, r=Ms2ger
Move `SmallVec::new` to top so it appears first in rustdoc. <!-- 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/39) <!-- Reviewable:end -->
2 parents 7b97ffc + 5cfa60d commit 918e573

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lib.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ pub struct SmallVec<A: Array> {
137137
}
138138

139139
impl<A: Array> SmallVec<A> {
140+
#[inline]
141+
pub fn new() -> SmallVec<A> {
142+
unsafe {
143+
SmallVec {
144+
len: 0,
145+
data: Inline { array: mem::zeroed() },
146+
}
147+
}
148+
}
149+
140150
pub unsafe fn set_len(&mut self, new_len: usize) {
141151
self.len = new_len
142152
}
@@ -435,18 +445,6 @@ impl<A: Array> fmt::Debug for SmallVec<A> where A::Item: fmt::Debug {
435445
}
436446
}
437447

438-
impl<A: Array> SmallVec<A> {
439-
#[inline]
440-
pub fn new() -> SmallVec<A> {
441-
unsafe {
442-
SmallVec {
443-
len: 0,
444-
data: Inline { array: mem::zeroed() },
445-
}
446-
}
447-
}
448-
}
449-
450448
impl<A: Array> Default for SmallVec<A> {
451449
#[inline]
452450
fn default() -> SmallVec<A> {

0 commit comments

Comments
 (0)