From 27e0ab578cc0fc4c72da54bbeb42c0c44d848207 Mon Sep 17 00:00:00 2001 From: Charles Gleason Date: Tue, 29 Oct 2019 10:45:54 -0400 Subject: [PATCH] Use truncate(0) in VecDeque clear --- src/liballoc/collections/vec_deque.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liballoc/collections/vec_deque.rs b/src/liballoc/collections/vec_deque.rs index fffd3a9dedae9..7795083e0580c 100644 --- a/src/liballoc/collections/vec_deque.rs +++ b/src/liballoc/collections/vec_deque.rs @@ -1141,7 +1141,7 @@ impl VecDeque { #[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