Feed: Remove unnecessary function wrapper

This commit is contained in:
Jordan Petridis 2018-09-02 21:27:05 +03:00
parent 0476b67b2f
commit 145d45f800
No known key found for this signature in database
GPG Key ID: E8523968931763BE

View File

@ -26,7 +26,7 @@ pub struct Feed {
impl Feed {
/// Index the contents of the RSS `Feed` into the database.
pub fn index(self) -> impl Future<Item = (), Error = DataError> + Send {
self.parse_podcast_async()
ok(self.parse_podcast())
.and_then(|pd| pd.to_podcast())
.and_then(move |pd| self.index_channel_items(pd))
}
@ -35,10 +35,6 @@ impl Feed {
NewShow::new(&self.channel, self.source_id)
}
fn parse_podcast_async(&self) -> impl Future<Item = NewShow, Error = DataError> + Send {
ok(self.parse_podcast())
}
fn index_channel_items(self, pd: Show) -> impl Future<Item = (), Error = DataError> + Send {
let stream = stream::iter_ok::<_, DataError>(self.channel.into_items());