@@ -774,9 +774,9 @@ pub enum KeyDerivationType {
774774 BLS = 1 ,
775775}
776776
777- impl Into < u32 > for KeyDerivationType {
778- fn into ( self ) -> u32 {
779- match self {
777+ impl From < KeyDerivationType > for u32 {
778+ fn from ( val : KeyDerivationType ) -> Self {
779+ match val {
780780 KeyDerivationType :: ECDSA => 0 ,
781781 KeyDerivationType :: BLS => 1 ,
782782 }
@@ -985,7 +985,7 @@ impl IntoDerivationPath for String {
985985 }
986986}
987987
988- impl < ' a > IntoDerivationPath for & ' a str {
988+ impl IntoDerivationPath for & str {
989989 fn into_derivation_path ( self ) -> Result < DerivationPath , Error > {
990990 self . parse ( )
991991 }
@@ -1443,10 +1443,7 @@ impl ExtendedPrivKey {
14431443 let parent_fingerprint = data[ 5 ..9 ] . try_into ( ) . expect ( "4 bytes for fingerprint" ) ;
14441444
14451445 let hardening_byte = data[ 9 ] ;
1446- let is_hardened = match hardening_byte {
1447- 0x00 => false ,
1448- _ => true ,
1449- } ;
1446+ let is_hardened = !matches ! ( hardening_byte, 0x00 ) ;
14501447
14511448 let child_number_bytes = data[ 10 ..42 ] . try_into ( ) . expect ( "32 bytes for child number" ) ;
14521449 let child_number = if is_hardened {
@@ -1778,10 +1775,7 @@ impl ExtendedPubKey {
17781775 let parent_fingerprint = data[ 5 ..9 ] . try_into ( ) . expect ( "4 bytes for fingerprint" ) ;
17791776
17801777 let hardening_byte = data[ 9 ] ;
1781- let is_hardened = match hardening_byte {
1782- 0x00 => false ,
1783- _ => true ,
1784- } ;
1778+ let is_hardened = !matches ! ( hardening_byte, 0x00 ) ;
17851779
17861780 let child_number_bytes = data[ 10 ..42 ] . try_into ( ) . expect ( "32 bytes for child number" ) ;
17871781 let child_number = if is_hardened {
0 commit comments