diff --git a/src/lib.rs b/src/lib.rs index 1e6f513..c72cc8b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -471,18 +471,7 @@ impl AllOrSome> { /// and the second element /// is a map of strings which failed to parse into URLs and their associated parse errors. pub fn new_from_str_list(urls: &[&str]) -> (Self, HashMap) { - let (ok_set, error_map): (Vec<_>, Vec<_>) = urls.iter() - .map(|s| (s.to_string(), Url::from_str(s))) - .partition(|&(_, ref r)| r.is_ok()); - - let error_map = error_map - .into_iter() - .map(|(s, r)| (s.to_string(), r.unwrap_err())) - .collect(); - - let ok_set = ok_set.into_iter().map(|(_, r)| r.unwrap()).collect(); - - (AllOrSome::Some(ok_set), error_map) + AllowedOrigins::some(urls) } }