From 31d5fd2b83dbcad5f73289583f2330882e41a08e Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 20 Oct 2024 22:13:10 +0200 Subject: [PATCH] fix --- src/db.rs | 2 +- src/item.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db.rs b/src/db.rs index 5c441a5..0999819 100644 --- a/src/db.rs +++ b/src/db.rs @@ -27,7 +27,7 @@ impl ItemDB { /// Retrieves an item by name pub fn get_item(&self, item: &str) -> Option<&Item> { - self.index.get(item) + self.index.get(&item.to_lowercase()) } /// Get all items diff --git a/src/item.rs b/src/item.rs index 9fdba58..a407b4a 100644 --- a/src/item.rs +++ b/src/item.rs @@ -56,7 +56,7 @@ impl Item { pub fn new(doc: &mdq::Document) -> Self { let path = std::path::Path::new(&doc.path); - let id = path.file_stem().unwrap().to_str().unwrap().to_string(); + let id = path.file_stem().unwrap().to_str().unwrap().to_lowercase(); let image_path = get_image(path);