diff --git a/src/jar.rs b/src/jar.rs index 29953103..16ed46a1 100644 --- a/src/jar.rs +++ b/src/jar.rs @@ -586,6 +586,18 @@ impl CookieJar { } } +use std::iter::FromIterator; + +impl FromIterator> for CookieJar { + fn from_iter>>(iter: T) -> Self { + let mut jar = Self::new(); + for cookie in iter.into_iter() { + jar.add_original(cookie); + } + jar + } +} + use std::collections::hash_set::Iter as HashSetIter; /// Iterator over the changes to a cookie jar.