From 7de6d6bf7bc1d7335518decd0efcc80dc81fc402 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 21 Sep 2024 01:49:56 +0200 Subject: [PATCH] fix --- src/db.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db.rs b/src/db.rs index cd04b02..57bc915 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,4 +1,4 @@ -use mongod::Model; +use mongod::{Model, Referencable}; use crate::item::Item; @@ -30,7 +30,7 @@ impl ItemDB { .documents .iter() .map(Item::new) // <-- todo : performance? - .find(|x| x.name == item) + .find(|x| x.id() == item) } /// Get all items