fix: error when atom omits an entry

This commit is contained in:
2026-02-15 11:38:02 +01:00
parent 4cad06e456
commit bad80ba1d3
4 changed files with 5 additions and 5 deletions
Generated
+1 -1
View File
@@ -962,7 +962,7 @@ dependencies = [
[[package]]
name = "rss_library"
version = "0.3.2"
version = "0.3.3"
dependencies = [
"atom_syndication",
"reqwest",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rss_library"
version = "0.3.2"
version = "0.3.3"
edition = "2024"
[dependencies]
+2 -2
View File
@@ -1,5 +1,5 @@
use std::error::Error;
use atom_syndication::{Entry, Feed};
use std::error::Error;
pub async fn get_content(source: &str) -> Result<Feed, Box<dyn Error>> {
let content = reqwest::get(source).await?;
@@ -20,7 +20,7 @@ pub fn get_new<'a>(feed: &'a Feed, latest: &str) -> &'a [Entry] {
.position(|entry| entry.id() == latest)
.map(|i| &feed.entries()[0..i])
{
None => feed.entries(),
None => &[],
Some(list) => list,
}
}
+1 -1
View File
@@ -1,3 +1,3 @@
pub mod atom;
pub mod discord;
pub mod rss;
pub mod atom;