diff options
| author | Joe Carstairs <me@joeac.net> | 2026-09-05 20:38:46 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-09-05 20:38:46 +0100 |
| commit | f7be10edfc3719ea51170680e8ef3260bb941186 (patch) | |
| tree | 7c52eae8a7b11d06f7f77f83b2950fc8c5b20572 /src/retrieve.rs | |
| parent | 7995cf1a6df3e602f96c50f03fdd558da87049b5 (diff) | |
aggregate feeds into one
Diffstat (limited to 'src/retrieve.rs')
| -rw-r--r-- | src/retrieve.rs | 3 |
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> |
