Implement ArrayVec::clear

This commit is contained in:
root
2015-05-23 03:12:27 +02:00
parent e91a018220
commit 3175d97f80
+4
View File
@@ -107,6 +107,10 @@ impl<A: Array> ArrayVec<A> {
#[inline]
pub fn capacity(&self) -> usize { A::capacity() }
/// Remove all elements in the vector.
pub fn clear(&mut self) {
while let Some(_) = self.pop() { }
}
/// Push **element** to the end of the vector.
///