Skip to content
Permalink
Browse files

Replace a boxed iterator with impl Trait

  • Loading branch information
mbrubeck committed May 11, 2018
1 parent 1d8283e commit eca7e42fbda9a3931ec77ce7e48df98473bf5f8c
Showing with 3 additions and 3 deletions.
  1. +3 −3 components/net/cookie_storage.rs
@@ -175,14 +175,14 @@ impl CookieStorage {
pub fn cookies_data_for_url<'a>(&'a mut self,
url: &'a ServoUrl,
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 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.cookie.clone()
}))
})
}
}

0 comments on commit eca7e42

Please sign in to comment.
You can’t perform that action at this time.