about summary refs log tree commit diff
path: root/src/liballoc/collections
diff options
context:
space:
mode:
authorCharles Gleason <charles_gleason@alumni.brown.edu>2019-10-29 10:45:54 -0400
committerCharles Gleason <charles_gleason@alumni.brown.edu>2019-10-29 10:45:54 -0400
commit27e0ab578cc0fc4c72da54bbeb42c0c44d848207 (patch)
tree797d6c1b6d25e68eb48db618ae9c129ccf898f21 /src/liballoc/collections
parent71191bc3e9c592e6f52a646414fd9e337e3f3407 (diff)
downloadrust-27e0ab578cc0fc4c72da54bbeb42c0c44d848207.tar.gz
rust-27e0ab578cc0fc4c72da54bbeb42c0c44d848207.zip
Use truncate(0) in VecDeque clear
Diffstat (limited to 'src/liballoc/collections')
-rw-r--r--src/liballoc/collections/vec_deque.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs
index fffd3a9deda..7795083e058 100644
--- a/src/liballoc/collections/vec_deque.rs
+++ b/src/liballoc/collections/vec_deque.rs
@@ -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