Skip to content

Commit abcec45

Browse files
committed
Merge #399: Use KeySource instead of tuple
f8945d0 Use KeySource instead of tuple (Tobin C. Harding) Pull request description: Clippy emits: warning: very complex type used. Consider factoring parts into `type` definitions The type we return is more complex than needed because we do not use the `bip32::KeySource` alias but instead write the full tuple `(byp32::Fingerprint, bip32::DerivationPath)`. To fix the clippy warning we have at least 3 options 1. Add an alias for the complex return type 2. Add a compiler directive to quieten clippy 3. Use `bip32::KeySource` instead of tuple (1) seems like an overkill (2) means we loose lint coverage for the whole function Elect to do (3), the best of 3 imperfect solutions. ACKs for top commit: apoelstra: ACK f8945d0 sanket1729: ACK f8945d0 Tree-SHA512: a3f8112d29cdb81d09492277958cad895bdcc4cb933d68b4d25c02cf0ca079922a0d903c3e48ec701bc51f15d8c66d05e9dc7ba56031c28d4a88bc7df1fbaa89
2 parents 69440a4 + f8945d0 commit abcec45

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/descriptor/key.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ impl FromStr for DescriptorSecretKey {
539539
impl<K: InnerXKey> DescriptorXKey<K> {
540540
fn parse_xkey_origin(
541541
s: &str,
542-
) -> Result<(&str, Option<(bip32::Fingerprint, bip32::DerivationPath)>), DescriptorKeyParseError>
543-
{
542+
) -> Result<(&str, Option<bip32::KeySource>), DescriptorKeyParseError> {
544543
for ch in s.as_bytes() {
545544
if *ch < 20 || *ch > 127 {
546545
return Err(DescriptorKeyParseError(

0 commit comments

Comments
 (0)