Skip to content

Commit 9d9008c

Browse files
committed
Remove destructuring in Cookie and SetCookie
1 parent c53be8c commit 9d9008c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/header/common/cookie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Cookies {
6666
/// to manipulate cookies and create a corresponding `SetCookie` header afterwards.
6767
pub fn to_cookie_jar(&self, key: &[u8]) -> CookieJar<'static> {
6868
let mut jar = CookieJar::new(key);
69-
for cookie in self.0.iter() {
69+
for cookie in self.iter() {
7070
jar.add_original(cookie.clone());
7171
}
7272
jar

src/header/common/set_cookie.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ impl SetCookie {
6767
/// Use this on client to apply changes from SetCookie to CookieJar.
6868
/// Note that this will `panic!` if `CookieJar` is not root.
6969
pub fn apply_to_cookie_jar(&self, jar: &mut CookieJar) {
70-
let &SetCookie(ref cookies) = self;
71-
for cookie in cookies.iter() {
70+
for cookie in self.iter() {
7271
jar.add_original(cookie.clone())
7372
}
7473
}

0 commit comments

Comments
 (0)