Skip to content

Commit

Permalink
Replace a boxed iterator with impl Trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed May 11, 2018
1 parent 1d8283e commit eca7e42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/net/cookie_storage.rs
Expand Up @@ -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()
}))
})
}
}

Expand Down

0 comments on commit eca7e42

Please sign in to comment.