From eca7e42fbda9a3931ec77ce7e48df98473bf5f8c Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 11 May 2018 09:12:00 -0700 Subject: [PATCH] Replace a boxed iterator with impl Trait --- components/net/cookie_storage.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/net/cookie_storage.rs b/components/net/cookie_storage.rs index b3147ef4dd32..4dc7075a9fd0 100644 --- a/components/net/cookie_storage.rs +++ b/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> + 'a> { + -> impl Iterator> + '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() - })) + }) } }