From 9fba4dc45d7319d03584fe10ead95d0ff7974234 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 29 Aug 2022 23:19:49 +0200 Subject: more bugs --- code/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'code/src/main.rs') diff --git a/code/src/main.rs b/code/src/main.rs index 693c120..83bcefe 100644 --- a/code/src/main.rs +++ b/code/src/main.rs @@ -74,7 +74,7 @@ pub fn get_articles(root: &str) -> Vec { pub struct ArticleMeta { title: String, - filename: String, + canonical_name: String, date: iso8601::Date, path: PathBuf, } @@ -85,7 +85,7 @@ fn article_metadata(path: PathBuf) -> ArticleMeta { f.read_line(&mut buf).unwrap(); // assume the 1st line has the title ArticleMeta { title: String::from(buf[2..].trim()), - filename: path.file_name().unwrap().to_str().unwrap().to_string(), + canonical_name: path.file_stem().unwrap().to_str().unwrap().to_string(), date: iso8601::date(&path.file_name().unwrap().to_str().unwrap()[0..10]).unwrap(), path, } -- cgit v1.2.3-70-g09d2