mirror of https://github.com/fafhrd91/actix-web
Apply suggestions from code review
This commit is contained in:
parent
cd5322ddea
commit
72838752a3
|
@ -515,9 +515,9 @@ where
|
||||||
cx: &mut Context<'_>,
|
cx: &mut Context<'_>,
|
||||||
) -> Result<(), DispatchError> {
|
) -> Result<(), DispatchError> {
|
||||||
// Handle `EXPECT: 100-Continue` header
|
// Handle `EXPECT: 100-Continue` header
|
||||||
// set dispatcher state so the future is pinned.
|
|
||||||
let mut this = self.as_mut().project();
|
let mut this = self.as_mut().project();
|
||||||
if req.head().expect() {
|
if req.head().expect() {
|
||||||
|
// set dispatcher state so the future is pinned.
|
||||||
let task = this.flow.expect.call(req);
|
let task = this.flow.expect.call(req);
|
||||||
this.state.set(State::ExpectCall(task));
|
this.state.set(State::ExpectCall(task));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -282,7 +282,7 @@ impl HttpRequest {
|
||||||
if let Ok(cookies) = self.cookies() {
|
if let Ok(cookies) = self.cookies() {
|
||||||
for cookie in cookies.iter() {
|
for cookie in cookies.iter() {
|
||||||
if cookie.name() == name {
|
if cookie.name() == name {
|
||||||
return Some(cookie.clone());
|
return Some(cookie.to_owned());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,10 @@ impl<B> HttpResponse<B> {
|
||||||
pub fn del_cookie(&mut self, name: &str) -> usize {
|
pub fn del_cookie(&mut self, name: &str) -> usize {
|
||||||
let headers = self.headers_mut();
|
let headers = self.headers_mut();
|
||||||
|
|
||||||
let vals: Vec<HeaderValue> = headers.get_all(header::SET_COOKIE).cloned().collect();
|
let vals: Vec<HeaderValue> = headers
|
||||||
|
.get_all(header::SET_COOKIE)
|
||||||
|
.map(|v| v.to_owned())
|
||||||
|
.collect();
|
||||||
|
|
||||||
headers.remove(header::SET_COOKIE);
|
headers.remove(header::SET_COOKIE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue