From 8cf8e36b2a7f8f5f92a88bfded725b2510bfc8b3 Mon Sep 17 00:00:00 2001 From: davidemazzocchi Date: Tue, 30 Sep 2025 17:02:02 +0200 Subject: [PATCH] refactor: use items.insert instead of insert to add entities after load --- 01.workspace/heave/src/str/catalog.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/01.workspace/heave/src/str/catalog.rs b/01.workspace/heave/src/str/catalog.rs index 298a1ff..ebf18c1 100644 --- a/01.workspace/heave/src/str/catalog.rs +++ b/01.workspace/heave/src/str/catalog.rs @@ -73,14 +73,16 @@ impl O { let entity = sqlite::load::by_id(path, id); match entity { None => (), - Some(entity) => self.insert(entity), + Some(entity) => { + self.items.insert(entity.id.clone(), entity); + } } } pub fn load_by_class(&mut self, class: &str) { let path = path::Path::new(&self.path); let entities = sqlite::load::by_class(path, class); for entity in entities { - self.insert(entity); + self.items.insert(entity.id.clone(), entity); } } }