diff options
Diffstat (limited to 'vendor/rayon/src/collections')
-rw-r--r-- | vendor/rayon/src/collections/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<Vec<T>>> 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)); } } |