Skip to content

Commit

Permalink
Use truncate(0) in VecDeque clear
Browse files Browse the repository at this point in the history
  • Loading branch information
crgl committed Oct 29, 2019
1 parent 71191bc commit 27e0ab5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/liballoc/collections/vec_deque.rs
Expand Up @@ -1141,7 +1141,7 @@ impl<T> VecDeque<T> {
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn clear(&mut self) {
self.drain(..);
self.truncate(0);
}

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

0 comments on commit 27e0ab5

Please sign in to comment.