From 6e5c70ab71873e159df139762eff7ff3648a3c64 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Sat, 12 May 2018 13:19:14 +0300 Subject: [PATCH] opml: Change the signature of import_opml function. xml::reader::Error is the only error that can be returned so there is no need to use the DataError type. --- hammond-data/src/opml.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hammond-data/src/opml.rs b/hammond-data/src/opml.rs index 9da756a..675d32b 100644 --- a/hammond-data/src/opml.rs +++ b/hammond-data/src/opml.rs @@ -25,12 +25,13 @@ pub struct Opml { } /// Import feed url's from a `R` into the `Source` table. -pub fn opml_import(reader: R) -> Result>, DataError> { - let feeds = extract_sources(reader)?; - Ok(feeds +pub fn opml_import(reader: R) -> Result>, reader::Error> { + let feeds = extract_sources(reader)? .iter() .map(|opml| Source::from_url(&opml.url)) - .collect()) + .collect(); + + Ok(feeds) } /// Extracts the `outline` elemnts from a reader `R` and returns a `HashSet` of `Opml` structs.