Skip to content

Commit

Permalink
Auto merge of #39 - servo:new, r=Ms2ger
Browse files Browse the repository at this point in the history
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 -->
  • Loading branch information
bors-servo authored Nov 22, 2016
2 parents 7b97ffc + 5cfa60d commit 918e573
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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> {
Expand Down

0 comments on commit 918e573

Please sign in to comment.