Skip to content

Commit

Permalink
Maker & Taker Actors does not need to be mut, applying cargo suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu-maeda committed Dec 21, 2023
1 parent dbd6f33 commit cb46c80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/maker/maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Maker {
maker_dir_path: impl AsRef<Path>,
) -> Self {
let (tx, rx) = mpsc::channel::<MakerRequest>(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 }
}
Expand All @@ -134,8 +134,7 @@ impl Maker {
maker_data_path: impl AsRef<Path>,
) -> Result<(Uuid, Self), N3xbError> {
let (tx, rx) = mpsc::channel::<MakerRequest>(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))
Expand Down
5 changes: 2 additions & 3 deletions src/taker/taker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl Taker {
taker_dir_path: impl AsRef<Path>,
) -> Self {
let (tx, rx) = mpsc::channel::<TakerRequest>(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 }
Expand All @@ -108,8 +108,7 @@ impl Taker {
taker_data_path: impl AsRef<Path>,
) -> Result<(Uuid, Self), N3xbError> {
let (tx, rx) = mpsc::channel::<TakerRequest>(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))
Expand Down

0 comments on commit cb46c80

Please sign in to comment.