Feed: add parse_channel_items_future method.
This commit is contained in:
parent
bf4f655ed2
commit
fa03c20b00
@ -91,6 +91,22 @@ impl Feed {
|
|||||||
new_episodes
|
new_episodes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This could also retrurn a FutureResult<Vec<FutureNewEpisode, Error>>, Error> Instead
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn parse_channel_items_future(
|
||||||
|
&self,
|
||||||
|
pd: &Podcast,
|
||||||
|
) -> Box<Vec<FutureResult<NewEpisode, Error>>> {
|
||||||
|
let items = self.channel.items();
|
||||||
|
|
||||||
|
let episodes: Vec<_> = items
|
||||||
|
.par_iter()
|
||||||
|
.map(|item| result(parser::new_episode(item, pd.id())))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
Box::new(episodes)
|
||||||
|
}
|
||||||
|
|
||||||
// #[cfg(test)]
|
// #[cfg(test)]
|
||||||
// /// This returns only the episodes in the xml feed.
|
// /// This returns only the episodes in the xml feed.
|
||||||
// fn get_episodes(&self) -> Result<Vec<Episode>> {
|
// fn get_episodes(&self) -> Result<Vec<Episode>> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user