@@ -197,7 +197,7 @@ impl BlockingClient {
197197
198198 /// Get a [`Transaction`] option given its [`Txid`]
199199 pub fn get_tx ( & self , txid : & Txid ) -> Result < Option < Transaction > , Error > {
200- self . get_opt_response ( & format ! ( "/tx/{}/raw" , txid ) )
200+ self . get_opt_response ( & format ! ( "/tx/{txid }/raw" ) )
201201 }
202202
203203 /// Get a [`Transaction`] given its [`Txid`].
@@ -216,44 +216,44 @@ impl BlockingClient {
216216 block_hash : & BlockHash ,
217217 index : usize ,
218218 ) -> Result < Option < Txid > , Error > {
219- self . get_opt_response_txid ( & format ! ( "/block/{}/txid/{}" , block_hash , index ) )
219+ self . get_opt_response_txid ( & format ! ( "/block/{block_hash }/txid/{index}" ) )
220220 }
221221
222222 /// Get the status of a [`Transaction`] given its [`Txid`].
223223 pub fn get_tx_status ( & self , txid : & Txid ) -> Result < TxStatus , Error > {
224- self . get_response_json ( & format ! ( "/tx/{}/status" , txid ) )
224+ self . get_response_json ( & format ! ( "/tx/{txid }/status" ) )
225225 }
226226
227227 /// Get transaction info given it's [`Txid`].
228228 pub fn get_tx_info ( & self , txid : & Txid ) -> Result < Option < Tx > , Error > {
229- self . get_opt_response_json ( & format ! ( "/tx/{}" , txid ) )
229+ self . get_opt_response_json ( & format ! ( "/tx/{txid}" ) )
230230 }
231231
232232 /// Get a [`BlockHeader`] given a particular block hash.
233233 pub fn get_header_by_hash ( & self , block_hash : & BlockHash ) -> Result < BlockHeader , Error > {
234- self . get_response_hex ( & format ! ( "/block/{}/header" , block_hash ) )
234+ self . get_response_hex ( & format ! ( "/block/{block_hash }/header" ) )
235235 }
236236
237237 /// Get the [`BlockStatus`] given a particular [`BlockHash`].
238238 pub fn get_block_status ( & self , block_hash : & BlockHash ) -> Result < BlockStatus , Error > {
239- self . get_response_json ( & format ! ( "/block/{}/status" , block_hash ) )
239+ self . get_response_json ( & format ! ( "/block/{block_hash }/status" ) )
240240 }
241241
242242 /// Get a [`Block`] given a particular [`BlockHash`].
243243 pub fn get_block_by_hash ( & self , block_hash : & BlockHash ) -> Result < Option < Block > , Error > {
244- self . get_opt_response ( & format ! ( "/block/{}/raw" , block_hash ) )
244+ self . get_opt_response ( & format ! ( "/block/{block_hash }/raw" ) )
245245 }
246246
247247 /// Get a merkle inclusion proof for a [`Transaction`] with the given
248248 /// [`Txid`].
249249 pub fn get_merkle_proof ( & self , txid : & Txid ) -> Result < Option < MerkleProof > , Error > {
250- self . get_opt_response_json ( & format ! ( "/tx/{}/merkle-proof" , txid ) )
250+ self . get_opt_response_json ( & format ! ( "/tx/{txid }/merkle-proof" ) )
251251 }
252252
253253 /// Get a [`MerkleBlock`] inclusion proof for a [`Transaction`] with the
254254 /// given [`Txid`].
255255 pub fn get_merkle_block ( & self , txid : & Txid ) -> Result < Option < MerkleBlock > , Error > {
256- self . get_opt_response_hex ( & format ! ( "/tx/{}/merkleblock-proof" , txid ) )
256+ self . get_opt_response_hex ( & format ! ( "/tx/{txid }/merkleblock-proof" ) )
257257 }
258258
259259 /// Get the spending status of an output given a [`Txid`] and the output
@@ -263,7 +263,7 @@ impl BlockingClient {
263263 txid : & Txid ,
264264 index : u64 ,
265265 ) -> Result < Option < OutputStatus > , Error > {
266- self . get_opt_response_json ( & format ! ( "/tx/{}/outspend/{}" , txid , index ) )
266+ self . get_opt_response_json ( & format ! ( "/tx/{txid }/outspend/{index}" ) )
267267 }
268268
269269 /// Broadcast a [`Transaction`] to Esplora
@@ -309,7 +309,7 @@ impl BlockingClient {
309309
310310 /// Get the [`BlockHash`] of a specific block height
311311 pub fn get_block_hash ( & self , block_height : u32 ) -> Result < BlockHash , Error > {
312- self . get_response_str ( & format ! ( "/block-height/{}" , block_height ) )
312+ self . get_response_str ( & format ! ( "/block-height/{block_height}" ) )
313313 . map ( |s| BlockHash :: from_str ( s. as_str ( ) ) . map_err ( Error :: HexToArray ) ) ?
314314 }
315315
@@ -354,8 +354,8 @@ impl BlockingClient {
354354 ) -> Result < Vec < Tx > , Error > {
355355 let script_hash = sha256:: Hash :: hash ( script. as_bytes ( ) ) ;
356356 let path = match last_seen {
357- Some ( last_seen) => format ! ( "/scripthash/{:x}/txs/chain/{}" , script_hash , last_seen ) ,
358- None => format ! ( "/scripthash/{:x}/txs" , script_hash ) ,
357+ Some ( last_seen) => format ! ( "/scripthash/{script_hash :x}/txs/chain/{last_seen}" ) ,
358+ None => format ! ( "/scripthash/{script_hash :x}/txs" ) ,
359359 } ;
360360 self . get_response_json ( & path)
361361 }
@@ -367,7 +367,7 @@ impl BlockingClient {
367367 /// esplora returns `10` while [mempool.space](https://mempool.space/docs/api) returns `15`.
368368 pub fn get_blocks ( & self , height : Option < u32 > ) -> Result < Vec < BlockSummary > , Error > {
369369 let path = match height {
370- Some ( height) => format ! ( "/blocks/{}" , height ) ,
370+ Some ( height) => format ! ( "/blocks/{height}" ) ,
371371 None => "/blocks" . to_string ( ) ,
372372 } ;
373373 let blocks: Vec < BlockSummary > = self . get_response_json ( & path) ?;
0 commit comments