diff --git a/daemon/src/taker_cfd.rs b/daemon/src/taker_cfd.rs index 7164068..84d9b2b 100644 --- a/daemon/src/taker_cfd.rs +++ b/daemon/src/taker_cfd.rs @@ -384,18 +384,16 @@ where } } +#[xtra_productivity] impl Actor where Self: xtra::Handler, O: xtra::Handler + xtra::Handler, W: xtra::Handler + xtra::Handler, { - async fn handle_take_offer( - &mut self, - order_id: OrderId, - quantity: Usd, - ctx: &mut Context, - ) -> Result<()> { + async fn handle_take_offer(&mut self, msg: TakeOffer, ctx: &mut Context) -> Result<()> { + let TakeOffer { order_id, quantity } = msg; + let disconnected = self .setup_actors .get_disconnected(order_id) @@ -627,19 +625,6 @@ where } } -#[async_trait] -impl Handler for Actor -where - Self: xtra::Handler, - O: xtra::Handler + xtra::Handler, - W: xtra::Handler + xtra::Handler, -{ - async fn handle(&mut self, msg: TakeOffer, ctx: &mut Context) -> Result<()> { - self.handle_take_offer(msg.order_id, msg.quantity, ctx) - .await - } -} - #[async_trait] impl Handler for Actor where @@ -732,10 +717,6 @@ impl Handler for Actor } } -impl Message for TakeOffer { - type Result = Result<()>; -} - impl Message for CfdRollOverCompleted { type Result = (); }