summaryrefslogtreecommitdiffstats
path: root/vendor/rayon/src/collections
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:32 +0000
commit4547b622d8d29df964fa2914213088b148c498fc (patch)
tree9fc6b25f3c3add6b745be9a2400a6e96140046e9 /vendor/rayon/src/collections
parentReleasing progress-linux version 1.66.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-4547b622d8d29df964fa2914213088b148c498fc.tar.xz
rustc-4547b622d8d29df964fa2914213088b148c498fc.zip
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rayon/src/collections')
-rw-r--r--vendor/rayon/src/collections/mod.rs4
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));
}
}