From 37e60fc7f9b6a1e9c89e1b05b8e38d88e4f829c9 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Mon, 5 Jul 2021 09:58:49 +0200 Subject: [PATCH] chore: fix new clippy complaint (#3915) --- tokio-stream/src/stream_ext/collect.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tokio-stream/src/stream_ext/collect.rs b/tokio-stream/src/stream_ext/collect.rs index 23f48b049..a33a6d669 100644 --- a/tokio-stream/src/stream_ext/collect.rs +++ b/tokio-stream/src/stream_ext/collect.rs @@ -113,7 +113,7 @@ impl> sealed::FromStreamPriv for String { } fn finalize(_: sealed::Internal, collection: &mut String) -> String { - mem::replace(collection, String::new()) + mem::take(collection) } } @@ -132,7 +132,7 @@ impl sealed::FromStreamPriv for Vec { } fn finalize(_: sealed::Internal, collection: &mut Vec) -> Vec { - mem::replace(collection, vec![]) + mem::take(collection) } }