Skip to content

Commit 98a7605

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 b614477 commit 98a7605

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/descriptor/key.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ impl DescriptorSecretKey {
254254
&self,
255255
secp: &Secp256k1<C>,
256256
) -> 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)?)
257+
let pk = match self {
258+
DescriptorSecretKey::SinglePriv(prv) => {
259+
DescriptorPublicKey::SinglePub(prv.to_public(secp))
263260
}
264-
})
261+
DescriptorSecretKey::XPrv(xprv) => DescriptorPublicKey::XPub(xprv.to_public(secp)?),
262+
};
263+
264+
Ok(pk)
265265
}
266266
}
267267

0 commit comments

Comments
 (0)