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);