Skip to content

Commit f8945d0

Browse files
committed
Use KeySource instead of tuple
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 f8945d0

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
@@ -528,8 +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>
532-
{
531+
) -> Result<(&str, Option<bip32::KeySource>), DescriptorKeyParseError> {
533532
for ch in s.as_bytes() {
534533
if *ch < 20 || *ch > 127 {
535534
return Err(DescriptorKeyParseError(

0 commit comments

Comments
 (0)