From cb46c80ee6c45af0c2be44f390e1a8836b6e65ad Mon Sep 17 00:00:00 2001 From: "nobu.maeda" Date: Thu, 21 Dec 2023 16:42:05 +0800 Subject: [PATCH] Maker & Taker Actors does not need to be mut, applying cargo suggestions --- src/maker/maker.rs | 5 ++--- src/taker/taker.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/maker/maker.rs b/src/maker/maker.rs index 342f96b..edcc903 100644 --- a/src/maker/maker.rs +++ b/src/maker/maker.rs @@ -124,7 +124,7 @@ impl Maker { maker_dir_path: impl AsRef, ) -> Self { let (tx, rx) = mpsc::channel::(Self::MAKER_REQUEST_CHANNEL_SIZE); - let mut actor = MakerActor::new(rx, comms_accessor, order, maker_dir_path).await; + let actor = MakerActor::new(rx, comms_accessor, order, maker_dir_path).await; let task_handle = tokio::spawn(async move { actor.run().await }); Self { tx, task_handle } } @@ -134,8 +134,7 @@ impl Maker { maker_data_path: impl AsRef, ) -> Result<(Uuid, Self), N3xbError> { let (tx, rx) = mpsc::channel::(Self::MAKER_REQUEST_CHANNEL_SIZE); - let (trade_uuid, mut actor) = - MakerActor::restore(rx, comms_accessor, maker_data_path).await?; + let (trade_uuid, actor) = MakerActor::restore(rx, comms_accessor, maker_data_path).await?; let task_handle = tokio::spawn(async move { actor.run().await }); let maker = Self { tx, task_handle }; Ok((trade_uuid, maker)) diff --git a/src/taker/taker.rs b/src/taker/taker.rs index c0b97dd..df3d3ee 100644 --- a/src/taker/taker.rs +++ b/src/taker/taker.rs @@ -97,7 +97,7 @@ impl Taker { taker_dir_path: impl AsRef, ) -> Self { let (tx, rx) = mpsc::channel::(Self::TAKER_REQUEST_CHANNEL_SIZE); - let mut actor = + let actor = TakerActor::new(rx, comms_accessor, order_envelope, offer, taker_dir_path).await; let task_handle = tokio::spawn(async move { actor.run().await }); Self { tx, task_handle } @@ -108,8 +108,7 @@ impl Taker { taker_data_path: impl AsRef, ) -> Result<(Uuid, Self), N3xbError> { let (tx, rx) = mpsc::channel::(Self::TAKER_REQUEST_CHANNEL_SIZE); - let (trade_uuid, mut actor) = - TakerActor::restore(rx, comms_accessor, taker_data_path).await?; + let (trade_uuid, actor) = TakerActor::restore(rx, comms_accessor, taker_data_path).await?; let task_handle = tokio::spawn(async move { actor.run().await }); let taker = Self { tx, task_handle }; Ok((trade_uuid, taker))