@@ -86,14 +86,10 @@ impl DerivPaths {
8686 }
8787
8888 /// Get the list of derivation paths.
89- pub fn paths ( & self ) -> & Vec < bip32:: DerivationPath > {
90- & self . 0
91- }
89+ pub fn paths ( & self ) -> & Vec < bip32:: DerivationPath > { & self . 0 }
9290
9391 /// Get the list of derivation paths.
94- pub fn into_paths ( self ) -> Vec < bip32:: DerivationPath > {
95- self . 0
96- }
92+ pub fn into_paths ( self ) -> Vec < bip32:: DerivationPath > { self . 0 }
9793}
9894
9995/// Instance of one or more extended keys, as specified in BIP 389.
@@ -173,19 +169,15 @@ impl InnerXKey for bip32::ExtendedPubKey {
173169 self . fingerprint ( )
174170 }
175171
176- fn can_derive_hardened ( ) -> bool {
177- false
178- }
172+ fn can_derive_hardened ( ) -> bool { false }
179173}
180174
181175impl InnerXKey for bip32:: ExtendedPrivKey {
182176 fn xkey_fingerprint < C : Signing > ( & self , secp : & Secp256k1 < C > ) -> bip32:: Fingerprint {
183177 self . fingerprint ( secp)
184178 }
185179
186- fn can_derive_hardened ( ) -> bool {
187- true
188- }
180+ fn can_derive_hardened ( ) -> bool { true }
189181}
190182
191183/// Whether a descriptor has a wildcard in it
@@ -271,16 +263,12 @@ impl DescriptorXKey<bip32::ExtendedPrivKey> {
271263pub struct DescriptorKeyParseError ( & ' static str ) ;
272264
273265impl fmt:: Display for DescriptorKeyParseError {
274- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
275- f. write_str ( self . 0 )
276- }
266+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result { f. write_str ( self . 0 ) }
277267}
278268
279269#[ cfg( feature = "std" ) ]
280270impl error:: Error for DescriptorKeyParseError {
281- fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
282- None
283- }
271+ fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > { None }
284272}
285273
286274impl fmt:: Display for DescriptorPublicKey {
@@ -621,9 +609,7 @@ impl DescriptorPublicKey {
621609
622610 /// Whether or not the key has a wildcard
623611 #[ deprecated( note = "use has_wildcard instead" ) ]
624- pub fn is_deriveable ( & self ) -> bool {
625- self . has_wildcard ( )
626- }
612+ pub fn is_deriveable ( & self ) -> bool { self . has_wildcard ( ) }
627613
628614 /// Whether or not the key has a wildcard
629615 pub fn has_wildcard ( & self ) -> bool {
@@ -1093,9 +1079,7 @@ impl DefiniteDescriptorKey {
10931079 }
10941080
10951081 /// The fingerprint of the master key associated with this key, `0x00000000` if none.
1096- pub fn master_fingerprint ( & self ) -> bip32:: Fingerprint {
1097- self . 0 . master_fingerprint ( )
1098- }
1082+ pub fn master_fingerprint ( & self ) -> bip32:: Fingerprint { self . 0 . master_fingerprint ( ) }
10991083
11001084 /// Full path from the master key if not a multipath extended key.
11011085 pub fn full_derivation_path ( & self ) -> Option < bip32:: DerivationPath > {
@@ -1109,14 +1093,10 @@ impl DefiniteDescriptorKey {
11091093 }
11101094
11111095 /// Reference to the underlying `DescriptorPublicKey`
1112- pub fn as_descriptor_public_key ( & self ) -> & DescriptorPublicKey {
1113- & self . 0
1114- }
1096+ pub fn as_descriptor_public_key ( & self ) -> & DescriptorPublicKey { & self . 0 }
11151097
11161098 /// Converts the definite key into a generic one
1117- pub fn into_descriptor_public_key ( self ) -> DescriptorPublicKey {
1118- self . 0
1119- }
1099+ pub fn into_descriptor_public_key ( self ) -> DescriptorPublicKey { self . 0 }
11201100}
11211101
11221102impl FromStr for DefiniteDescriptorKey {
@@ -1131,9 +1111,7 @@ impl FromStr for DefiniteDescriptorKey {
11311111}
11321112
11331113impl fmt:: Display for DefiniteDescriptorKey {
1134- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1135- self . 0 . fmt ( f)
1136- }
1114+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result { self . 0 . fmt ( f) }
11371115}
11381116
11391117impl MiniscriptKey for DefiniteDescriptorKey {
@@ -1142,17 +1120,11 @@ impl MiniscriptKey for DefiniteDescriptorKey {
11421120 type Ripemd160 = ripemd160:: Hash ;
11431121 type Hash160 = hash160:: Hash ;
11441122
1145- fn is_uncompressed ( & self ) -> bool {
1146- self . 0 . is_uncompressed ( )
1147- }
1123+ fn is_uncompressed ( & self ) -> bool { self . 0 . is_uncompressed ( ) }
11481124
1149- fn is_x_only_key ( & self ) -> bool {
1150- self . 0 . is_x_only_key ( )
1151- }
1125+ fn is_x_only_key ( & self ) -> bool { self . 0 . is_x_only_key ( ) }
11521126
1153- fn num_der_paths ( & self ) -> usize {
1154- self . 0 . num_der_paths ( )
1155- }
1127+ fn num_der_paths ( & self ) -> usize { self . 0 . num_der_paths ( ) }
11561128}
11571129
11581130impl ToPublicKey for DefiniteDescriptorKey {
@@ -1161,33 +1133,21 @@ impl ToPublicKey for DefiniteDescriptorKey {
11611133 self . derive_public_key ( & secp) . unwrap ( )
11621134 }
11631135
1164- fn to_sha256 ( hash : & sha256:: Hash ) -> sha256:: Hash {
1165- * hash
1166- }
1136+ fn to_sha256 ( hash : & sha256:: Hash ) -> sha256:: Hash { * hash }
11671137
1168- fn to_hash256 ( hash : & hash256:: Hash ) -> hash256:: Hash {
1169- * hash
1170- }
1138+ fn to_hash256 ( hash : & hash256:: Hash ) -> hash256:: Hash { * hash }
11711139
1172- fn to_ripemd160 ( hash : & ripemd160:: Hash ) -> ripemd160:: Hash {
1173- * hash
1174- }
1140+ fn to_ripemd160 ( hash : & ripemd160:: Hash ) -> ripemd160:: Hash { * hash }
11751141
1176- fn to_hash160 ( hash : & hash160:: Hash ) -> hash160:: Hash {
1177- * hash
1178- }
1142+ fn to_hash160 ( hash : & hash160:: Hash ) -> hash160:: Hash { * hash }
11791143}
11801144
11811145impl From < DefiniteDescriptorKey > for DescriptorPublicKey {
1182- fn from ( d : DefiniteDescriptorKey ) -> Self {
1183- d. 0
1184- }
1146+ fn from ( d : DefiniteDescriptorKey ) -> Self { d. 0 }
11851147}
11861148
11871149impl Borrow < DescriptorPublicKey > for DefiniteDescriptorKey {
1188- fn borrow ( & self ) -> & DescriptorPublicKey {
1189- & self . 0
1190- }
1150+ fn borrow ( & self ) -> & DescriptorPublicKey { & self . 0 }
11911151}
11921152
11931153#[ cfg( feature = "serde" ) ]
0 commit comments