mirror of
https://github.com/openharmony/third_party_rust_rust-smallvec.git
synced 2026-07-21 01:55:25 -04:00
Move SmallVec::new to top so it appears first in rustdoc.
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user