Fix odd compilation error on newer Rust
continuous-integration/drone/push Build is failing Details

This commit is contained in:
projectmoon 2024-12-04 21:55:26 +01:00
parent 1fe590925b
commit 46088bb627
3 changed files with 587 additions and 315 deletions

892
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "gemfreely"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
license = "AGPL-3.0-or-later"
description = "Synchronize Gemini protocol blogs to the Fediverse"

View File

@ -146,7 +146,11 @@ impl Gemfeed {
settings: &GemfeedParserSettings,
) -> Result<Gemfeed> {
if let Some(content) = resp.content() {
let feed = content.parse::<AtomFeed>()?;
let feed = match content.parse::<AtomFeed>() {
Ok(feed) => feed,
Err(_) => return Err(anyhow!("Could not parse Atom feed")),
};
let entries = parse_atom(&feed, settings)?;
let title = feed.title();
Ok(Self::new(url, title, entries))
@ -245,7 +249,7 @@ impl GemfeedEntry {
slug: self.slug,
published: self.published,
url: self.url,
body: OnceCell::from(body)
body: OnceCell::from(body),
}
}