Skip to content

Commit 5c0ecd7

Browse files
committed
Remove unused error return
The `to_public` method on `DescriptorSinglePriv` never errors, no need to return an error type.
1 parent ab6e1d8 commit 5c0ecd7

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/descriptor/key.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,14 @@ pub enum Wildcard {
137137
}
138138

139139
impl SinglePriv {
140-
/// Returns the public key of this key
141-
fn to_public<C: Signing>(
142-
&self,
143-
secp: &Secp256k1<C>,
144-
) -> Result<SinglePub, DescriptorKeyParseError> {
140+
/// Returns the public key of this key.
141+
fn to_public<C: Signing>(&self, secp: &Secp256k1<C>) -> SinglePub {
145142
let pub_key = self.key.public_key(secp);
146143

147-
Ok(SinglePub {
144+
SinglePub {
148145
origin: self.origin.clone(),
149146
key: SinglePubKey::FullKey(pub_key),
150-
})
147+
}
151148
}
152149
}
153150

@@ -254,9 +251,7 @@ impl DescriptorSecretKey {
254251
secp: &Secp256k1<C>,
255252
) -> Result<DescriptorPublicKey, DescriptorKeyParseError> {
256253
Ok(match self {
257-
&DescriptorSecretKey::Single(ref sk) => {
258-
DescriptorPublicKey::Single(sk.to_public(secp)?)
259-
}
254+
&DescriptorSecretKey::Single(ref sk) => DescriptorPublicKey::Single(sk.to_public(secp)),
260255
&DescriptorSecretKey::XPrv(ref xprv) => {
261256
DescriptorPublicKey::XPub(xprv.to_public(secp)?)
262257
}

0 commit comments

Comments
 (0)