Skip to content

Commit

Permalink
Move SmallVec::new to top so it appears first in rustdoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Nov 19, 2016
1 parent 7b97ffc commit 5cfa60d
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 5cfa60d

Please sign in to comment.