From 885c525d7bbbc14716ea726f15505b51cf3c6475 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Wed, 18 Apr 2018 04:05:14 +0300 Subject: [PATCH] Pipeline: change the signature of pipeline to accept `future::Stream` instead of `IntoIterator`. --- hammond-data/src/pipeline.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hammond-data/src/pipeline.rs b/hammond-data/src/pipeline.rs index 44decb3..3611a9f 100644 --- a/hammond-data/src/pipeline.rs +++ b/hammond-data/src/pipeline.rs @@ -55,10 +55,9 @@ pub fn pipeline<'a, S>( client: HttpsClient, ) -> Box, Error = DataError> + 'a> where - S: IntoIterator + 'a, + S: Stream + 'a, { - let stream = iter_ok::<_, DataError>(sources); - let pipeline = stream + let pipeline = sources .and_then(clone!(client => move |s| s.into_feed(client.clone(), ignore_etags))) .and_then(|feed| feed.index()) // the stream will stop at the first error so @@ -82,7 +81,8 @@ where .connector(HttpsConnector::new(num_cpus::get(), &handle)?) .build(&handle); - let p = pipeline(sources, ignore_etags, client); + let stream = iter_ok::<_, DataError>(sources); + let p = pipeline(stream, ignore_etags, client); core.run(p).map(|_| ()) }