diff --git a/src/ship/items/transaction.rs b/src/ship/items/transaction.rs index 805f6d1..4c385c5 100644 --- a/src/ship/items/transaction.rs +++ b/src/ship/items/transaction.rs @@ -57,37 +57,6 @@ impl<'a, T, EG: EntityGateway> ItemTransaction<'a, T, EG> { } } - /* - pub fn act(mut self, action: fn(&mut ItemTransactionActions, &T) -> Result) -> ItemTransaction<'a, U, E, EG> { - if self.error.is_none() { - let k = action(&mut self.actions, &self.prev.unwrap()); - match k { - Ok(k) => { - ItemTransaction { - error: None, - prev: Some(k), - actions: self.actions, - } - }, - Err(err) => { - ItemTransaction { - error: Some(err), - prev: None, - actions: self.actions, - } - } - } - } - else { - ItemTransaction { - error: self.error, - prev: None, - actions: self.actions, - } - } - } -*/ - pub fn act(mut self, action: fn(&mut ItemTransactionActions, &T) -> Result) -> FinalizedItemTransaction { match action(&mut self.actions, &self.data) { Ok(k) => { @@ -104,16 +73,6 @@ impl<'a, T, EG: EntityGateway> ItemTransaction<'a, T, EG> { } } } - - /* - pub fn finalize(self) -> FinalizedItemTransaction { - FinalizedItemTransaction { - error: self.error, - prev: self.prev, - action_queue: self.actions.action_queue, - } - } -*/ } @@ -137,8 +96,6 @@ impl FinalizedItemTransaction { for action in self.action_queue.into_iter() { // TODO: better handle rolling back if this ever errors out - //let result = action.item_action(item_manager).await.map_err(|err| TransactionError::Commit(err.into()))?; - //action.gateway_action(entity_gateway, result).await.map_err(|err| TransactionError::Commit(err.into()))?; action.commit(item_manager, entity_gateway).await.map_err(|err| TransactionError::Commit(err))?; } Ok(value)