Skip to content

Commit ae1eff5

Browse files
committed
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.
1 parent c0076e6 commit ae1eff5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/descriptor/key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl FromStr for DescriptorSecretKey {
528528
impl<K: InnerXKey> DescriptorXKey<K> {
529529
fn parse_xkey_origin(
530530
s: &str,
531-
) -> Result<(&str, Option<(bip32::Fingerprint, bip32::DerivationPath)>), DescriptorKeyParseError>
531+
) -> Result<(&str, Option<bip32::KeySource>), DescriptorKeyParseError>
532532
{
533533
for ch in s.as_bytes() {
534534
if *ch < 20 || *ch > 127 {

0 commit comments

Comments
 (0)