From 49f358d97d2150cf04d9ce33be55aadb9bb27875 Mon Sep 17 00:00:00 2001 From: glyph Date: Wed, 17 Jun 2020 18:32:45 +0100 Subject: [PATCH] Replace unwraps --- src/bin/generate_rss.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/generate_rss.rs b/src/bin/generate_rss.rs index 4af4032..9ac2dba 100644 --- a/src/bin/generate_rss.rs +++ b/src/bin/generate_rss.rs @@ -16,8 +16,7 @@ fn main() -> Result<(), Box> { .description( "glyph's RSS feed. Biophilic musings on carbon-based and silicon-based technologies.", ) - .build() - .unwrap(); + .build()?; // list template directories containing articles for syndication let bacteria = "./templates/bacteria"; @@ -46,7 +45,11 @@ fn main() -> Result<(), Box> { // populate item url vector from article filenames let re_url = Regex::new("./templates/(.*).html.tera")?; - let caps_url = re_url.captures(&path.to_str().unwrap()); + let caps_url = re_url.captures( + &path + .to_str() + .expect("Failed to convert file path to string slice for regex capture"), + ); if let Some(url) = caps_url { let article_url = url[1].replace("_", "-"); let full_url = format!("https://mycelial.technology/{}", article_url);