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 -->
This commit is contained in:
bors-servo
2016-11-22 08:10:22 -06:00
committed by GitHub
+10 -12
View File
@@ -137,6 +137,16 @@ pub struct SmallVec<A: Array> {
}
impl<A: Array> SmallVec<A> {
#[inline]
pub fn new() -> SmallVec<A> {
unsafe {
SmallVec {
len: 0,
data: Inline { array: mem::zeroed() },
}
}
}
pub unsafe fn set_len(&mut self, new_len: usize) {
self.len = new_len
}
@@ -435,18 +445,6 @@ impl<A: Array> fmt::Debug for SmallVec<A> where A::Item: fmt::Debug {
}
}
impl<A: Array> SmallVec<A> {
#[inline]
pub fn new() -> SmallVec<A> {
unsafe {
SmallVec {
len: 0,
data: Inline { array: mem::zeroed() },
}
}
}
}
impl<A: Array> Default for SmallVec<A> {
#[inline]
fn default() -> SmallVec<A> {