summaryrefslogtreecommitdiff
path: root/src/retrieve.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/retrieve.rs')
-rw-r--r--src/retrieve.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/retrieve.rs b/src/retrieve.rs
index ee904ab..3b89138 100644
--- a/src/retrieve.rs
+++ b/src/retrieve.rs
@@ -2,13 +2,12 @@ use futures::{StreamExt, stream};
use isahc::AsyncReadResponseExt;
use rss::Channel;
-pub async fn retrieve<'a, I>(urls: I) -> Vec<Channel>
+pub async fn retrieve<'a, I>(urls: I) -> impl StreamExt<Item = Channel>
where I : IntoIterator<Item = &'a str>
{
stream::iter(urls)
.flat_map(|url| stream::once(retrieve_one_or_warn(url)))
.filter_map(async |result| result.ok())
- .collect().await
}
async fn retrieve_one_or_warn(url: &str) -> anyhow::Result<Channel>