feat: replace persist with insert (in memory)

This commit is contained in:
2025-09-29 13:18:53 +02:00
parent 5d06946a4c
commit b7790e2f47
2 changed files with 4 additions and 5 deletions

View File

@@ -13,9 +13,9 @@ impl O {
..O::default()
}
}
pub fn persist(&mut self, entity: &mut Entity) {
self.items.insert(entity.id.clone(), entity.clone());
entity.persisted = true;
pub fn insert(&mut self, object: impl ToEAV) {
let entity = object.to_eav();
self.items.insert(entity.id.clone(), entity);
}
}

View File

@@ -130,7 +130,6 @@ mod tests {
name: "laptop".to_string(),
price: 200000u64,
};
let mut entity = product.to_eav();
catalog.persist(&mut entity);
catalog.insert(product);
}
}