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.
This commit is contained in:
parent
ab4f958b5f
commit
6e5c70ab71
@ -25,12 +25,13 @@ pub struct Opml {
|
||||
}
|
||||
|
||||
/// Import feed url's from a `R` into the `Source` table.
|
||||
pub fn opml_import<R: Read>(reader: R) -> Result<Vec<Result<Source, DataError>>, DataError> {
|
||||
let feeds = extract_sources(reader)?;
|
||||
Ok(feeds
|
||||
pub fn opml_import<R: Read>(reader: R) -> Result<Vec<Result<Source, DataError>>, 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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user