Remove explicit error conversion
We provide a `From<secp255k1::Error>` impl so we do not need to explicitly convert the error return, just use `?`.
This commit is contained in:
parent
d86517ae4f
commit
13d5c0536b
|
@ -31,7 +31,7 @@ impl Signature {
|
||||||
64 => {
|
64 => {
|
||||||
// default type
|
// default type
|
||||||
let sig =
|
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 })
|
Ok(Signature { sig, hash_ty: TapSighashType::Default })
|
||||||
}
|
}
|
||||||
65 => {
|
65 => {
|
||||||
|
@ -39,7 +39,7 @@ impl Signature {
|
||||||
let hash_ty = TapSighashType::from_consensus_u8(*hash_ty)
|
let hash_ty = TapSighashType::from_consensus_u8(*hash_ty)
|
||||||
.map_err(|_| Error::InvalidSighashType(*hash_ty))?;
|
.map_err(|_| Error::InvalidSighashType(*hash_ty))?;
|
||||||
let sig =
|
let sig =
|
||||||
secp256k1::schnorr::Signature::from_slice(sig).map_err(Error::Secp256k1)?;
|
secp256k1::schnorr::Signature::from_slice(sig)?;
|
||||||
Ok(Signature { sig, hash_ty })
|
Ok(Signature { sig, hash_ty })
|
||||||
}
|
}
|
||||||
len => Err(Error::InvalidSignatureSize(len)),
|
len => Err(Error::InvalidSignatureSize(len)),
|
||||||
|
|
Loading…
Reference in New Issue