Replace unwraps
This commit is contained in:
@ -16,8 +16,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
.description(
|
.description(
|
||||||
"glyph's RSS feed. Biophilic musings on carbon-based and silicon-based technologies.",
|
"glyph's RSS feed. Biophilic musings on carbon-based and silicon-based technologies.",
|
||||||
)
|
)
|
||||||
.build()
|
.build()?;
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// list template directories containing articles for syndication
|
// list template directories containing articles for syndication
|
||||||
let bacteria = "./templates/bacteria";
|
let bacteria = "./templates/bacteria";
|
||||||
@ -46,7 +45,11 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
|
|
||||||
// populate item url vector from article filenames
|
// populate item url vector from article filenames
|
||||||
let re_url = Regex::new("./templates/(.*).html.tera")?;
|
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 {
|
if let Some(url) = caps_url {
|
||||||
let article_url = url[1].replace("_", "-");
|
let article_url = url[1].replace("_", "-");
|
||||||
let full_url = format!("https://mycelial.technology/{}", article_url);
|
let full_url = format!("https://mycelial.technology/{}", article_url);
|
||||||
|
Reference in New Issue
Block a user