@@ -18,12 +18,10 @@ pub enum RawTransactionError {
1818
1919impl fmt:: Display for RawTransactionError {
2020 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
21- use RawTransactionError as E ;
22-
2321 match * self {
24- E :: Inputs ( ref e) =>
22+ Self :: Inputs ( ref e) =>
2523 write_err ! ( f, "conversion of one of the transaction inputs failed" ; e) ,
26- E :: Outputs ( ref e) =>
24+ Self :: Outputs ( ref e) =>
2725 write_err ! ( f, "conversion of one of the transaction outputs failed" ; e) ,
2826 }
2927 }
@@ -32,11 +30,9 @@ impl fmt::Display for RawTransactionError {
3230#[ cfg( feature = "std" ) ]
3331impl std:: error:: Error for RawTransactionError {
3432 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
35- use RawTransactionError as E ;
36-
3733 match * self {
38- E :: Inputs ( ref e) => Some ( e) ,
39- E :: Outputs ( ref e) => Some ( e) ,
34+ Self :: Inputs ( ref e) => Some ( e) ,
35+ Self :: Outputs ( ref e) => Some ( e) ,
4036 }
4137 }
4238}
@@ -54,13 +50,11 @@ pub enum RawTransactionInputError {
5450
5551impl fmt:: Display for RawTransactionInputError {
5652 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
57- use RawTransactionInputError as E ;
58-
5953 match * self {
60- E :: Txid ( ref e) => write_err ! ( f, "conversion of the input `txid` field failed" ; e) ,
61- E :: ScriptSig ( ref e) =>
54+ Self :: Txid ( ref e) => write_err ! ( f, "conversion of the input `txid` field failed" ; e) ,
55+ Self :: ScriptSig ( ref e) =>
6256 write_err ! ( f, "conversion of the input `script_sig` field failed" ; e) ,
63- E :: Witness ( ref e) =>
57+ Self :: Witness ( ref e) =>
6458 write_err ! ( f, "conversion of one of the `witness` hex strings failed" ; e) ,
6559 }
6660 }
@@ -69,12 +63,10 @@ impl fmt::Display for RawTransactionInputError {
6963#[ cfg( feature = "std" ) ]
7064impl std:: error:: Error for RawTransactionInputError {
7165 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
72- use RawTransactionInputError as E ;
73-
7466 match * self {
75- E :: Txid ( ref e) => Some ( e) ,
76- E :: ScriptSig ( ref e) => Some ( e) ,
77- E :: Witness ( ref e) => Some ( e) ,
67+ Self :: Txid ( ref e) => Some ( e) ,
68+ Self :: ScriptSig ( ref e) => Some ( e) ,
69+ Self :: Witness ( ref e) => Some ( e) ,
7870 }
7971 }
8072}
@@ -90,11 +82,9 @@ pub enum RawTransactionOutputError {
9082
9183impl fmt:: Display for RawTransactionOutputError {
9284 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
93- use RawTransactionOutputError as E ;
94-
9585 match * self {
96- E :: Value ( ref e) => write_err ! ( f, "conversion of the output `value` field failed" ; e) ,
97- E :: ScriptPubkey ( ref e) =>
86+ Self :: Value ( ref e) => write_err ! ( f, "conversion of the output `value` field failed" ; e) ,
87+ Self :: ScriptPubkey ( ref e) =>
9888 write_err ! ( f, "conversion of the output `script_pubkey` field failed" ; e) ,
9989 }
10090 }
@@ -103,11 +93,9 @@ impl fmt::Display for RawTransactionOutputError {
10393#[ cfg( feature = "std" ) ]
10494impl std:: error:: Error for RawTransactionOutputError {
10595 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
106- use RawTransactionOutputError as E ;
107-
10896 match * self {
109- E :: Value ( ref e) => Some ( e) ,
110- E :: ScriptPubkey ( ref e) => Some ( e) ,
97+ Self :: Value ( ref e) => Some ( e) ,
98+ Self :: ScriptPubkey ( ref e) => Some ( e) ,
11199 }
112100 }
113101}
@@ -123,11 +111,9 @@ pub enum WitnessUtxoError {
123111
124112impl fmt:: Display for WitnessUtxoError {
125113 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
126- use WitnessUtxoError as E ;
127-
128114 match * self {
129- E :: Amount ( ref e) => write_err ! ( f, "conversion of the `amount` field failed" ; e) ,
130- E :: ScriptPubkey ( ref e) =>
115+ Self :: Amount ( ref e) => write_err ! ( f, "conversion of the `amount` field failed" ; e) ,
116+ Self :: ScriptPubkey ( ref e) =>
131117 write_err ! ( f, "conversion of the `script_pubkey` field failed" ; e) ,
132118 }
133119 }
@@ -136,11 +122,9 @@ impl fmt::Display for WitnessUtxoError {
136122#[ cfg( feature = "std" ) ]
137123impl std:: error:: Error for WitnessUtxoError {
138124 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
139- use WitnessUtxoError as E ;
140-
141125 match * self {
142- E :: Amount ( ref e) => Some ( e) ,
143- E :: ScriptPubkey ( ref e) => Some ( e) ,
126+ Self :: Amount ( ref e) => Some ( e) ,
127+ Self :: ScriptPubkey ( ref e) => Some ( e) ,
144128 }
145129 }
146130}
@@ -156,24 +140,20 @@ pub enum PartialSignatureError {
156140
157141impl fmt:: Display for PartialSignatureError {
158142 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
159- use PartialSignatureError as E ;
160-
161143 match * self {
162- E :: PublicKey ( ref e) =>
144+ Self :: PublicKey ( ref e) =>
163145 write_err ! ( f, "partial sigs key-value pair parse pubkey failed" ; e) ,
164- E :: Signature ( ref e) => write_err ! ( f, "partial sigs key-value pair parse sig failed" ; e) ,
146+ Self :: Signature ( ref e) => write_err ! ( f, "partial sigs key-value pair parse sig failed" ; e) ,
165147 }
166148 }
167149}
168150
169151#[ cfg( feature = "std" ) ]
170152impl std:: error:: Error for PartialSignatureError {
171153 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
172- use PartialSignatureError as E ;
173-
174154 match * self {
175- E :: PublicKey ( ref e) => Some ( e) ,
176- E :: Signature ( ref e) => Some ( e) ,
155+ Self :: PublicKey ( ref e) => Some ( e) ,
156+ Self :: Signature ( ref e) => Some ( e) ,
177157 }
178158 }
179159}
@@ -191,26 +171,22 @@ pub enum Bip32DerivError {
191171
192172impl fmt:: Display for Bip32DerivError {
193173 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
194- use Bip32DerivError as E ;
195-
196174 match * self {
197- E :: Pubkey ( ref e) => write_err ! ( f, "conversion of the pubkey failed" ; e) ,
198- E :: MasterFingerprint ( ref e) =>
175+ Self :: Pubkey ( ref e) => write_err ! ( f, "conversion of the pubkey failed" ; e) ,
176+ Self :: MasterFingerprint ( ref e) =>
199177 write_err ! ( f, "conversion of the `master_fingerprint` field failed" ; e) ,
200- E :: Path ( ref e) => write_err ! ( f, "conversion of the `path` field failed" ; e) ,
178+ Self :: Path ( ref e) => write_err ! ( f, "conversion of the `path` field failed" ; e) ,
201179 }
202180 }
203181}
204182
205183#[ cfg( feature = "std" ) ]
206184impl std:: error:: Error for Bip32DerivError {
207185 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
208- use Bip32DerivError as E ;
209-
210186 match * self {
211- E :: Pubkey ( ref e) => Some ( e) ,
212- E :: MasterFingerprint ( ref e) => Some ( e) ,
213- E :: Path ( ref e) => Some ( e) ,
187+ Self :: Pubkey ( ref e) => Some ( e) ,
188+ Self :: MasterFingerprint ( ref e) => Some ( e) ,
189+ Self :: Path ( ref e) => Some ( e) ,
214190 }
215191 }
216192}
0 commit comments