From 13d5c0536bc1c592475b8d652b7e34812db220a0 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 2 Jun 2023 14:32:06 +1000 Subject: [PATCH] Remove explicit error conversion We provide a `From` impl so we do not need to explicitly convert the error return, just use `?`. --- bitcoin/src/crypto/taproot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/crypto/taproot.rs b/bitcoin/src/crypto/taproot.rs index 96067bee..11c39c6f 100644 --- a/bitcoin/src/crypto/taproot.rs +++ b/bitcoin/src/crypto/taproot.rs @@ -31,7 +31,7 @@ impl Signature { 64 => { // default type let sig = - secp256k1::schnorr::Signature::from_slice(sl).map_err(Error::Secp256k1)?; + secp256k1::schnorr::Signature::from_slice(sl)?; Ok(Signature { sig, hash_ty: TapSighashType::Default }) } 65 => { @@ -39,7 +39,7 @@ impl Signature { let hash_ty = TapSighashType::from_consensus_u8(*hash_ty) .map_err(|_| Error::InvalidSighashType(*hash_ty))?; let sig = - secp256k1::schnorr::Signature::from_slice(sig).map_err(Error::Secp256k1)?; + secp256k1::schnorr::Signature::from_slice(sig)?; Ok(Signature { sig, hash_ty }) } len => Err(Error::InvalidSignatureSize(len)),