From a0e7c6ecf7c1afcf4d4f618e275226b63e220bd3 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Fri, 26 Feb 2021 15:53:25 +1100 Subject: [PATCH] Don't Arc the AtomicU32 We never clone this type, there is no need to wrap it in an `Arc`. --- swap/src/monero/wallet.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/swap/src/monero/wallet.rs b/swap/src/monero/wallet.rs index b37eba55..89e9be5d 100644 --- a/swap/src/monero/wallet.rs +++ b/swap/src/monero/wallet.rs @@ -12,11 +12,7 @@ use monero_rpc::{ wallet, wallet::{BlockHeight, Refreshed}, }; -use std::{ - str::FromStr, - sync::{atomic::Ordering, Arc}, - time::Duration, -}; +use std::{str::FromStr, sync::atomic::Ordering, time::Duration}; use tokio::sync::Mutex; use tracing::info; use url::Url; @@ -201,7 +197,7 @@ impl WatchForTransfer for Wallet { let address = Address::standard(self.network, public_spend_key, public_view_key.into()); - let confirmations = Arc::new(AtomicU32::new(0u32)); + let confirmations = AtomicU32::new(0u32); let res = retry(ConstantBackoff::new(Duration::from_secs(1)), || async { // NOTE: Currently, this is conflicting IO errors with the transaction not being