From 586123eb0ee8e86fa130ed96b75619046770cbcb Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 18 Nov 2016 22:40:02 -0500 Subject: [PATCH] Move `SmallVec::new` to top so it appears first in rustdoc. --- lib.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib.rs b/lib.rs index d125819..5c09b3c 100644 --- a/lib.rs +++ b/lib.rs @@ -137,6 +137,16 @@ pub struct SmallVec { } impl SmallVec { + #[inline] + pub fn new() -> SmallVec { + 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 fmt::Debug for SmallVec where A::Item: fmt::Debug { } } -impl SmallVec { - #[inline] - pub fn new() -> SmallVec { - unsafe { - SmallVec { - len: 0, - data: Inline { array: mem::zeroed() }, - } - } - } -} - impl Default for SmallVec { #[inline] fn default() -> SmallVec {