Skip to content

Commit 27b715d

Browse files
committed
Move associated types to top of struct
There is no obvious reason why the associated types for `MiniscriptKey` are below the trait methods. Move them to the top. Note, the diff shows moving functions not associated types - same thing. Refactor only, no logic changes.
1 parent c3c7f27 commit 27b715d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,6 @@ pub use crate::primitives::threshold::{Threshold, ThresholdError};
149149

150150
/// Trait representing a key which can be converted to a hash type.
151151
pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Hash {
152-
/// Returns true if the key is serialized uncompressed.
153-
fn is_uncompressed(&self) -> bool;
154-
155-
/// Returns true if the key is an x-only pubkey.
156-
fn is_x_only_key(&self) -> bool;
157-
158-
/// Returns the number of different derivation paths in this key.
159-
///
160-
/// Only >1 for keys in BIP389 multipath descriptors.
161-
fn num_der_paths(&self) -> usize;
162-
163152
/// The type used in the sha256 fragment.
164153
type Sha256: Clone + Eq + Ord + fmt::Display + fmt::Debug + hash::Hash;
165154

@@ -171,6 +160,17 @@ pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Ha
171160

172161
/// The type used in the hash160 fragment.
173162
type Hash160: Clone + Eq + Ord + fmt::Display + fmt::Debug + hash::Hash;
163+
164+
/// Returns true if the key is serialized uncompressed.
165+
fn is_uncompressed(&self) -> bool;
166+
167+
/// Returns true if the key is an x-only pubkey.
168+
fn is_x_only_key(&self) -> bool;
169+
170+
/// Returns the number of different derivation paths in this key.
171+
///
172+
/// Only >1 for keys in BIP389 multipath descriptors.
173+
fn num_der_paths(&self) -> usize;
174174
}
175175

176176
impl MiniscriptKey for bitcoin::secp256k1::PublicKey {

0 commit comments

Comments
 (0)