@@ -54,7 +54,9 @@ impl From<HttpClientError> for BlockSourceError {
5454 }
5555 } ,
5656 // Parse errors are persistent (invalid data)
57- HttpClientError :: Parse ( msg) => BlockSourceError :: persistent ( HttpClientError :: Parse ( msg) ) ,
57+ HttpClientError :: Parse ( msg) => {
58+ BlockSourceError :: persistent ( HttpClientError :: Parse ( msg) )
59+ } ,
5860 }
5961 }
6062}
@@ -81,12 +83,14 @@ impl From<RpcClientError> for BlockSourceError {
8183 ) ) )
8284 }
8385 } ,
84- HttpClientError :: Parse ( msg) => BlockSourceError :: persistent ( RpcClientError :: Http (
85- HttpClientError :: Parse ( msg) ,
86- ) ) ,
86+ HttpClientError :: Parse ( msg) => {
87+ BlockSourceError :: persistent ( RpcClientError :: Http ( HttpClientError :: Parse ( msg) ) )
88+ } ,
8789 } ,
8890 // RPC errors (e.g. "block not found") are transient
89- RpcClientError :: Rpc ( rpc_err) => BlockSourceError :: transient ( RpcClientError :: Rpc ( rpc_err) ) ,
91+ RpcClientError :: Rpc ( rpc_err) => {
92+ BlockSourceError :: transient ( RpcClientError :: Rpc ( rpc_err) )
93+ } ,
9094 // Malformed response data is persistent
9195 RpcClientError :: InvalidData ( msg) => {
9296 BlockSourceError :: persistent ( RpcClientError :: InvalidData ( msg) )
@@ -224,10 +228,7 @@ impl TryInto<(BlockHash, Option<u32>)> for JsonResponse {
224228impl TryInto < Txid > for JsonResponse {
225229 type Error = String ;
226230 fn try_into ( self ) -> Result < Txid , String > {
227- let hex_data = self
228- . 0
229- . as_str ( )
230- . ok_or_else ( || "expected JSON string" . to_string ( ) ) ?;
231+ let hex_data = self . 0 . as_str ( ) . ok_or_else ( || "expected JSON string" . to_string ( ) ) ?;
231232 Txid :: from_str ( hex_data) . map_err ( |err| err. to_string ( ) )
232233 }
233234}
0 commit comments