From 4547b622d8d29df964fa2914213088b148c498fc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:32 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/rayon/src/collections/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vendor/rayon/src/collections') diff --git a/vendor/rayon/src/collections/mod.rs b/vendor/rayon/src/collections/mod.rs index d9b7988da..3c99f32c4 100644 --- a/vendor/rayon/src/collections/mod.rs +++ b/vendor/rayon/src/collections/mod.rs @@ -56,7 +56,7 @@ mod drain_guard { pub(super) fn new(collection: &'a mut C) -> Self { Self { // Temporarily steal the inner `Vec` so we can drain in place. - vec: Vec::from(mem::replace(collection, C::default())), + vec: Vec::from(mem::take(collection)), collection, } } @@ -65,7 +65,7 @@ mod drain_guard { impl<'a, T, C: From>> Drop for DrainGuard<'a, T, C> { fn drop(&mut self) { // Restore the collection from the `Vec` with its original capacity. - *self.collection = C::from(mem::replace(&mut self.vec, Vec::new())); + *self.collection = C::from(mem::take(&mut self.vec)); } } -- cgit v1.2.3