From 9d4381c8fe636d2d1d63b394b246e939f1192de7 Mon Sep 17 00:00:00 2001 From: Daniel Roberts Date: Sun, 15 Jun 2025 23:14:26 -0500 Subject: [PATCH] Improve `Xpriv::derive_xpriv` and `Xpub::derive_xpub` ergonomics This change enables references to slices, arrays, and Vecs to be passed to derive methods. --- bitcoin/src/bip32.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitcoin/src/bip32.rs b/bitcoin/src/bip32.rs index 23b7d368c..b7659e072 100644 --- a/bitcoin/src/bip32.rs +++ b/bitcoin/src/bip32.rs @@ -756,7 +756,7 @@ impl Xpriv { pub fn derive_priv>( &self, secp: &Secp256k1, - path: &P, + path: P, ) -> Result { self.derive_xpriv(secp, path) } @@ -767,7 +767,7 @@ impl Xpriv { pub fn derive_xpriv>( &self, secp: &Secp256k1, - path: &P, + path: P, ) -> Result { let mut sk: Xpriv = *self; for cnum in path.as_ref() { @@ -910,7 +910,7 @@ impl Xpub { pub fn derive_pub>( &self, secp: &Secp256k1, - path: &P, + path: P, ) -> Result { self.derive_xpub(secp, path) } @@ -921,7 +921,7 @@ impl Xpub { pub fn derive_xpub>( &self, secp: &Secp256k1, - path: &P, + path: P, ) -> Result { let mut pk: Xpub = *self; for cnum in path.as_ref() {