From 93af3a84c69c1da75c247bfdf36b971891c282c8 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 28 Nov 2024 10:47:29 +1100 Subject: [PATCH] Do not manually map numeric error --- types/src/v17/wallet/into.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/types/src/v17/wallet/into.rs b/types/src/v17/wallet/into.rs index 186ee88..3130ca8 100644 --- a/types/src/v17/wallet/into.rs +++ b/types/src/v17/wallet/into.rs @@ -159,11 +159,8 @@ impl GetAddressInfo { .map_err(E::Pubkeys) }) .transpose()?; - let sigs_required = self - .sigs_required - .map(|s| crate::to_u32(s, "sigs_required")) - .transpose() - .map_err(E::Numeric)?; + let sigs_required = + self.sigs_required.map(|s| crate::to_u32(s, "sigs_required")).transpose()?; let pubkey = self.pubkey.map(|s| s.parse::()).transpose().map_err(E::Pubkey)?; let embedded = self.embedded.map(|embedded| embedded.into_model()).transpose().map_err(E::Embedded)?; @@ -254,11 +251,8 @@ impl GetAddressInfoEmbedded { .map(|s| s.parse::()) .collect::, _>>() .map_err(E::Pubkeys)?; - let sigs_required = self - .sigs_required - .map(|s| crate::to_u32(s, "sigs_required")) - .transpose() - .map_err(E::Numeric)?; + let sigs_required = + self.sigs_required.map(|s| crate::to_u32(s, "sigs_required")).transpose()?; let pubkey = self.pubkey.map(|s| s.parse::()).transpose().map_err(E::Pubkey)?; let labels = self.labels.into_iter().map(|label| label.into_model()).collect();