We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b614477 commit 98a7605Copy full SHA for 98a7605
src/descriptor/key.rs
@@ -254,14 +254,14 @@ impl DescriptorSecretKey {
254
&self,
255
secp: &Secp256k1<C>,
256
) -> Result<DescriptorPublicKey, DescriptorKeyParseError> {
257
- Ok(match self {
258
- &DescriptorSecretKey::SinglePriv(ref sk) => {
259
- DescriptorPublicKey::SinglePub(sk.to_public(secp)?)
260
- }
261
- &DescriptorSecretKey::XPrv(ref xprv) => {
262
- DescriptorPublicKey::XPub(xprv.to_public(secp)?)
+ let pk = match self {
+ DescriptorSecretKey::SinglePriv(prv) => {
+ DescriptorPublicKey::SinglePub(prv.to_public(secp))
263
}
264
- })
+ DescriptorSecretKey::XPrv(xprv) => DescriptorPublicKey::XPub(xprv.to_public(secp)?),
+ };
+
+ Ok(pk)
265
266
267
0 commit comments