diff options
| author | Joe Carstairs <me@joeac.net> | 2026-09-07 08:47:57 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-09-07 08:47:57 +0100 |
| commit | c1fc6b929dc0906c548f1af4c15f84b65b2d2ce6 (patch) | |
| tree | a772b67335e8c0e79414a398a7583f3479c7595a /src/main.rs | |
| parent | 9559966f777dec3389bd85a8a285e19165d057de (diff) | |
keep existing source if one exists on item
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 25a008d..2f1435b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,6 +71,8 @@ fn items_with_source(c: Channel) -> Vec<Item> { title: Some(c.title.clone()), }; c.into_items().into_iter() - .map(|mut item| { item.source = Some(source.clone()); item }) - .collect() + .map(|mut item| { + item.source = item.source.or_else(|| Some(source.clone())); + item + }).collect() } |
