From 0a86907dd228f8267940b67ad1b9883474f47625 Mon Sep 17 00:00:00 2001 From: Maksym Vorobiov Date: Sun, 16 Feb 2020 19:48:09 +0200 Subject: [PATCH] use mem::replace instead of mem::take rust 1.40+ --- actix-http/src/h1/dispatcher.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 043271cb..4bfcabab 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -780,10 +780,10 @@ where let inner_p = inner.as_mut().project(); let mut parts = FramedParts::with_read_buf( inner_p.io.take().unwrap(), - std::mem::take(inner_p.codec), - std::mem::take(inner_p.read_buf), + std::mem::replace(inner_p.codec, Codec::default()), + std::mem::replace(inner_p.read_buf, BytesMut::default()), ); - parts.write_buf = std::mem::take(inner_p.write_buf); + parts.write_buf = std::mem::replace(inner_p.write_buf, BytesMut::default()); let framed = Framed::from_parts(parts); let upgrade = inner_p.upgrade.take().unwrap().call((req, framed)); self.as_mut().project().inner.set(DispatcherState::Upgrade(upgrade));