Skip to content

Commit 27e0ab5

Browse files
committed
Use truncate(0) in VecDeque clear
1 parent 71191bc commit 27e0ab5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/liballoc/collections/vec_deque.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ impl<T> VecDeque<T> {
11411141
#[stable(feature = "rust1", since = "1.0.0")]
11421142
#[inline]
11431143
pub fn clear(&mut self) {
1144-
self.drain(..);
1144+
self.truncate(0);
11451145
}
11461146

11471147
/// Returns `true` if the `VecDeque` contains an element equal to the

0 commit comments

Comments
 (0)