Skip to content

Commit

Permalink
Move trait method
Browse files Browse the repository at this point in the history
Clean up `MiniscriptKey` implementation for `bitcoin::PublicKey`.

- Be uniform, put the trait method implementation below the associated types.
- Trait methods have documentation on the trait, remove the unnecessary
  rustdoc on the implementation.
  • Loading branch information
tcharding committed Oct 17, 2023
1 parent 0197c3e commit 263d1e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,12 @@ impl MiniscriptKey for bitcoin::secp256k1::PublicKey {
}

impl MiniscriptKey for bitcoin::PublicKey {
/// Returns the compressed-ness of the underlying secp256k1 key.
fn is_uncompressed(&self) -> bool { !self.compressed }

type Sha256 = sha256::Hash;
type Hash256 = hash256::Hash;
type Ripemd160 = ripemd160::Hash;
type Hash160 = hash160::Hash;

fn is_uncompressed(&self) -> bool { !self.compressed }
}

impl MiniscriptKey for bitcoin::secp256k1::XOnlyPublicKey {
Expand Down

0 comments on commit 263d1e8

Please sign in to comment.