|
|
@ -223,15 +223,6 @@ impl EntityGateway for InMemoryGateway { |
|
|
|
Ok(new_item)
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn change_item(&mut self, id: &ItemEntityId, item: &ItemDetail) -> Result<(), GatewayError> {
|
|
|
|
let mut items = self.items.lock().unwrap();
|
|
|
|
if let Some((_, ref mut old_item)) = items.iter_mut().find(|(existing_id, _)| **existing_id == *id) {
|
|
|
|
old_item.item = item.clone();
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn change_item_location(&mut self, item_id: &ItemEntityId, item_location: ItemLocation) -> Result<(), GatewayError> {
|
|
|
|
self.items.lock().unwrap().get_mut(&item_id)
|
|
|
|
.map(|item_entity| {
|
|
|
|