summaryrefslogtreecommitdiff
path: root/btc-wire/src
diff options
context:
space:
mode:
Diffstat (limited to 'btc-wire/src')
-rw-r--r--btc-wire/src/btc_config.rs2
-rw-r--r--btc-wire/src/loops/analysis.rs2
-rw-r--r--btc-wire/src/loops/worker.rs2
-rw-r--r--btc-wire/src/main.rs5
-rw-r--r--btc-wire/src/rpc.rs2
5 files changed, 8 insertions, 5 deletions
diff --git a/btc-wire/src/btc_config.rs b/btc-wire/src/btc_config.rs
index 58d85fe..85c96f4 100644
--- a/btc-wire/src/btc_config.rs
+++ b/btc-wire/src/btc_config.rs
@@ -83,7 +83,7 @@ impl BitcoinConfig {
Network::Testnet => conf.section(Some("test")),
Network::Signet => conf.section(Some("signet")),
Network::Regtest => conf.section(Some("regtest")),
- _ => unimplemented!()
+ _ => unimplemented!(),
};
let port = if let Some(addr) = section.and_then(|s| s.get("rpcport")) {
diff --git a/btc-wire/src/loops/analysis.rs b/btc-wire/src/loops/analysis.rs
index d2081d5..5d71758 100644
--- a/btc-wire/src/loops/analysis.rs
+++ b/btc-wire/src/loops/analysis.rs
@@ -24,7 +24,7 @@ pub fn analysis(rpc: &mut Rpc, current: u32, max: u32) -> LoopResult<u32> {
let fork = rpc
.get_chain_tips()?
.into_iter()
- .filter_map(|t| (t.status == ChainTipsStatus::ValidFork).then(|| t.length))
+ .filter_map(|t| (t.status == ChainTipsStatus::ValidFork).then_some(t.length))
.max()
.unwrap_or(0) as u32;
// If new fork is bigger than what current confirmation delay protect against
diff --git a/btc-wire/src/loops/worker.rs b/btc-wire/src/loops/worker.rs
index 3cd2aec..b26b902 100644
--- a/btc-wire/src/loops/worker.rs
+++ b/btc-wire/src/loops/worker.rs
@@ -176,7 +176,7 @@ fn sync_chain(
BlockHash,
) = {
// Get all transactions made since this block
- let list = rpc.list_since_block(Some(&last_hash), conf_delay as u32)?;
+ let list = rpc.list_since_block(Some(&last_hash), conf_delay)?;
// Only keep ids and category
let txs = list
.transactions
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
index edb82e5..d6c8e45 100644
--- a/btc-wire/src/main.rs
+++ b/btc-wire/src/main.rs
@@ -101,7 +101,10 @@ fn init(config: Option<PathBuf>, init: Init) -> LoopResult<()> {
// Create wallet
let passwd = password();
let created = match rpc.create_wallet(WIRE_WALLET_NAME, &passwd) {
- Err(rpc::Error::RPC { code, .. }) if code == ErrorCode::RpcWalletError => false,
+ Err(rpc::Error::RPC {
+ code: ErrorCode::RpcWalletError,
+ ..
+ }) => false,
Err(e) => panic!("{}", e),
Ok(_) => true,
};
diff --git a/btc-wire/src/rpc.rs b/btc-wire/src/rpc.rs
index 711cb39..83c55ad 100644
--- a/btc-wire/src/rpc.rs
+++ b/btc-wire/src/rpc.rs
@@ -356,7 +356,7 @@ impl Rpc {
add_inputs: true,
inputs,
subtract_fee_from_outputs: if subtract_fee {
- (0..nb_outputs).into_iter().collect()
+ (0..nb_outputs).collect()
} else {
vec![]
},