feat: replace persist with insert (in memory)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user