mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
Replace a boxed iterator with impl Trait
This commit is contained in:
parent
1d8283e010
commit
eca7e42fbd
1 changed files with 3 additions and 3 deletions
|
@ -175,14 +175,14 @@ impl CookieStorage {
|
||||||
pub fn cookies_data_for_url<'a>(&'a mut self,
|
pub fn cookies_data_for_url<'a>(&'a mut self,
|
||||||
url: &'a ServoUrl,
|
url: &'a ServoUrl,
|
||||||
source: CookieSource)
|
source: CookieSource)
|
||||||
-> Box<Iterator<Item = cookie_rs::Cookie<'static>> + 'a> {
|
-> impl Iterator<Item = cookie_rs::Cookie<'static>> + 'a {
|
||||||
let domain = reg_host(url.host_str().unwrap_or(""));
|
let domain = reg_host(url.host_str().unwrap_or(""));
|
||||||
let cookies = self.cookies_map.entry(domain).or_insert(vec![]);
|
let cookies = self.cookies_map.entry(domain).or_insert(vec![]);
|
||||||
|
|
||||||
Box::new(cookies.iter_mut().filter(move |c| c.appropriate_for_url(url, source)).map(|c| {
|
cookies.iter_mut().filter(move |c| c.appropriate_for_url(url, source)).map(|c| {
|
||||||
c.touch();
|
c.touch();
|
||||||
c.cookie.clone()
|
c.cookie.clone()
|
||||||
}))
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue