mirror of https://github.com/fafhrd91/actix-web
chore(awc): address clippy warnings (#3909)
This commit is contained in:
parent
bc27fd2724
commit
80d7d9c01a
|
|
@ -263,13 +263,9 @@ impl ClientRequest {
|
|||
/// ```
|
||||
#[cfg(feature = "cookies")]
|
||||
pub fn cookie(mut self, cookie: Cookie<'_>) -> Self {
|
||||
if self.cookies.is_none() {
|
||||
let mut jar = CookieJar::new();
|
||||
jar.add(cookie.into_owned());
|
||||
self.cookies = Some(jar)
|
||||
} else {
|
||||
self.cookies.as_mut().unwrap().add(cookie.into_owned());
|
||||
}
|
||||
self.cookies
|
||||
.get_or_insert_with(CookieJar::new)
|
||||
.add(cookie.into_owned());
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,13 +125,9 @@ impl WebsocketsRequest {
|
|||
/// Set a cookie
|
||||
#[cfg(feature = "cookies")]
|
||||
pub fn cookie(mut self, cookie: Cookie<'_>) -> Self {
|
||||
if self.cookies.is_none() {
|
||||
let mut jar = CookieJar::new();
|
||||
jar.add(cookie.into_owned());
|
||||
self.cookies = Some(jar)
|
||||
} else {
|
||||
self.cookies.as_mut().unwrap().add(cookie.into_owned());
|
||||
}
|
||||
self.cookies
|
||||
.get_or_insert_with(CookieJar::new)
|
||||
.add(cookie.into_owned());
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue