Skip to content

Commit be5e042

Browse files
committed
Re-factor DescriptorSecretKey::to_public
Do minor refactor to the `to_public` method on `DesciptorSecretKey`. Re-factor only, no logic changes.
1 parent d179959 commit be5e042

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/descriptor/key.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ impl DescriptorSecretKey {
253253
&self,
254254
secp: &Secp256k1<C>,
255255
) -> Result<DescriptorPublicKey, DescriptorKeyParseError> {
256-
Ok(match self {
257-
&DescriptorSecretKey::Single(ref sk) => DescriptorPublicKey::Single(sk.to_public(secp)),
258-
&DescriptorSecretKey::XPrv(ref xprv) => {
259-
DescriptorPublicKey::XPub(xprv.to_public(secp)?)
260-
}
261-
})
256+
let pk = match self {
257+
DescriptorSecretKey::Single(prv) => DescriptorPublicKey::Single(prv.to_public(secp)),
258+
DescriptorSecretKey::XPrv(xprv) => DescriptorPublicKey::XPub(xprv.to_public(secp)?),
259+
};
260+
261+
Ok(pk)
262262
}
263263
}
264264

0 commit comments

Comments
 (0)