From 1876d17ba456bcbc03b8854f5ed2444243ade75a Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 25 Feb 2021 12:51:30 +1100 Subject: [PATCH] Remove `map_err` in favor of `?` `?` maps the error automatically. --- swap/src/bitcoin/wallet.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/swap/src/bitcoin/wallet.rs b/swap/src/bitcoin/wallet.rs index 6f054a7c..74fc4983 100644 --- a/swap/src/bitcoin/wallet.rs +++ b/swap/src/bitcoin/wallet.rs @@ -82,11 +82,9 @@ impl Wallet { } pub async fn new_address(&self) -> Result
{ - self.inner - .lock() - .await - .get_new_address() - .map_err(Into::into) + let address = self.inner.lock().await.get_new_address()?; + + Ok(address) } pub async fn get_tx(&self, txid: Txid) -> Result> {