diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index 6b4b32090..deb25763c 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -515,9 +515,9 @@ where cx: &mut Context<'_>, ) -> Result<(), DispatchError> { // Handle `EXPECT: 100-Continue` header - // set dispatcher state so the future is pinned. let mut this = self.as_mut().project(); if req.head().expect() { + // set dispatcher state so the future is pinned. let task = this.flow.expect.call(req); this.state.set(State::ExpectCall(task)); } else { diff --git a/src/request.rs b/src/request.rs index 0248571b1..36d9aba98 100644 --- a/src/request.rs +++ b/src/request.rs @@ -282,7 +282,7 @@ impl HttpRequest { if let Ok(cookies) = self.cookies() { for cookie in cookies.iter() { if cookie.name() == name { - return Some(cookie.clone()); + return Some(cookie.to_owned()); } } } diff --git a/src/response/response.rs b/src/response/response.rs index ceeb43437..9a3bb2874 100644 --- a/src/response/response.rs +++ b/src/response/response.rs @@ -132,7 +132,10 @@ impl HttpResponse { pub fn del_cookie(&mut self, name: &str) -> usize { let headers = self.headers_mut(); - let vals: Vec = headers.get_all(header::SET_COOKIE).cloned().collect(); + let vals: Vec = headers + .get_all(header::SET_COOKIE) + .map(|v| v.to_owned()) + .collect(); headers.remove(header::SET_COOKIE);