Skip to content

Commit 590a01b

Browse files
Merge #12: Code cleanup
0b5f3c7 Implement Eq if all fields implement Eq (Gabriel Comte) 7c27d6b Remove to_string() because type implements Display (Gabriel Comte) Pull request description: Implement Clippy warnings Top commit has no ACKs. Tree-SHA512: 9992864ba90d8cc24694d397cf8f2f32a53f3a1429ac161a989f76179e2dc19bea7a7f12efd06dd73dda53c083753f647cf4247ebdad6c472fb6c5b5888a7476
2 parents 22faf52 + 0b5f3c7 commit 590a01b

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

src/api.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use bitcoin::{BlockHash, OutPoint, Script, Transaction, TxIn, TxOut, Txid, Witne
77

88
use serde::Deserialize;
99

10-
#[derive(Deserialize, Clone, Debug, PartialEq)]
10+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
1111
pub struct PrevOut {
1212
pub value: u64,
1313
pub scriptpubkey: Script,
1414
}
1515

16-
#[derive(Deserialize, Clone, Debug, PartialEq)]
16+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
1717
pub struct Vin {
1818
pub txid: Txid,
1919
pub vout: u32,
@@ -26,28 +26,28 @@ pub struct Vin {
2626
pub is_coinbase: bool,
2727
}
2828

29-
#[derive(Deserialize, Clone, Debug, PartialEq)]
29+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
3030
pub struct Vout {
3131
pub value: u64,
3232
pub scriptpubkey: Script,
3333
}
3434

35-
#[derive(Deserialize, Clone, Debug, PartialEq)]
35+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
3636
pub struct TxStatus {
3737
pub confirmed: bool,
3838
pub block_height: Option<u32>,
3939
pub block_hash: Option<BlockHash>,
4040
pub block_time: Option<u64>,
4141
}
4242

43-
#[derive(Deserialize, Clone, Debug, PartialEq)]
43+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
4444
pub struct MerkleProof {
4545
pub block_height: u32,
4646
pub merkle: Vec<Txid>,
4747
pub pos: usize,
4848
}
4949

50-
#[derive(Deserialize, Clone, Debug, PartialEq)]
50+
#[derive(Deserialize, Clone, Debug, PartialEq, Eq)]
5151
pub struct OutputStatus {
5252
pub spent: bool,
5353
pub txid: Option<Txid>,

src/async.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,7 @@ impl AsyncClient {
8787
) -> Result<Option<Txid>, Error> {
8888
let resp = self
8989
.client
90-
.get(&format!(
91-
"{}/block/{}/txid/{}",
92-
self.url,
93-
block_hash.to_string(),
94-
index
95-
))
90+
.get(&format!("{}/block/{}/txid/{}", self.url, block_hash, index))
9691
.send()
9792
.await?;
9893

src/blocking.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,7 @@ impl BlockingClient {
9292
) -> Result<Option<Txid>, Error> {
9393
let resp = self
9494
.agent
95-
.get(&format!(
96-
"{}/block/{}/txid/{}",
97-
self.url,
98-
block_hash.to_string(),
99-
index
100-
))
95+
.get(&format!("{}/block/{}/txid/{}", self.url, block_hash, index))
10196
.call();
10297

10398
match resp {

0 commit comments

Comments
 (0)