Feed: Remove unnecessary function wrapper
This commit is contained in:
parent
b05163632b
commit
ecadadd3ed
@ -26,7 +26,7 @@ pub struct Feed {
|
|||||||
impl Feed {
|
impl Feed {
|
||||||
/// Index the contents of the RSS `Feed` into the database.
|
/// Index the contents of the RSS `Feed` into the database.
|
||||||
pub fn index(self) -> impl Future<Item = (), Error = DataError> + Send {
|
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(|pd| pd.to_podcast())
|
||||||
.and_then(move |pd| self.index_channel_items(pd))
|
.and_then(move |pd| self.index_channel_items(pd))
|
||||||
}
|
}
|
||||||
@ -35,10 +35,6 @@ impl Feed {
|
|||||||
NewShow::new(&self.channel, self.source_id)
|
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 {
|
fn index_channel_items(self, pd: Show) -> impl Future<Item = (), Error = DataError> + Send {
|
||||||
let stream = stream::iter_ok::<_, DataError>(self.channel.into_items());
|
let stream = stream::iter_ok::<_, DataError>(self.channel.into_items());
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user