aboutsummaryrefslogtreecommitdiff
path: root/src/io/read_to_string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/read_to_string.rs')
-rw-r--r--src/io/read_to_string.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io/read_to_string.rs b/src/io/read_to_string.rs
index 457af59..c175396 100644
--- a/src/io/read_to_string.rs
+++ b/src/io/read_to_string.rs
@@ -22,7 +22,7 @@ impl<R: ?Sized + Unpin> Unpin for ReadToString<'_, R> {}
impl<'a, R: AsyncRead + ?Sized + Unpin> ReadToString<'a, R> {
pub(super) fn new(reader: &'a mut R, buf: &'a mut String) -> Self {
let start_len = buf.len();
- Self { reader, bytes: mem::replace(buf, String::new()).into_bytes(), buf, start_len }
+ Self { reader, bytes: mem::take(buf).into_bytes(), buf, start_len }
}
}