commit 005ae3486e8a8d35d4b74d850e449086d267cebd
parent 6944f01b20abf6922a0453960df6b728941ef4e0
Author: Antoine A <>
Date: Thu, 13 Jan 2022 19:29:24 +0100
Clippy fix
Diffstat:
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/btc-wire/src/bin/btc-wire-cli.rs b/btc-wire/src/bin/btc-wire-cli.rs
@@ -19,7 +19,7 @@ fn main() {
}
"initwallet" => {
let btc_conf =
- BitcoinConfig::load(config.btc_data_dir.unwrap_or(default_data_dir())).unwrap();
+ BitcoinConfig::load(config.btc_data_dir.unwrap_or_else(default_data_dir)).unwrap();
let mut rpc = BtcRpc::common(&btc_conf).unwrap();
let created = match rpc.create_wallet(WIRE_WALLET_NAME) {
Err(Error::RPC { code, .. }) if code == ErrorCode::RpcWalletError => false,
diff --git a/btc-wire/src/bin/test.rs b/btc-wire/src/bin/test.rs
@@ -22,7 +22,7 @@ pub fn main() {
panic!("Do not run tests on the mainnet, you are going to loose money")
}
Network::Testnet | Network::Signet => {
- println!("{}", "Running on testnet, slow network mining")
+ println!("Running on testnet, slow network mining")
}
Network::Regtest => println!("Running on regtest, fast manual mining"),
}
@@ -362,11 +362,11 @@ impl TestRunner {
let result = std::panic::catch_unwind(AssertUnwindSafe(test));
if result.is_ok() {
- println!("{}", "OK");
+ println!("OK");
self.nb_ok += 1;
} else {
dbg!(&result);
- println!("{}", "ERR");
+ println!("ERR");
self.nb_err += 1;
}
}
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
@@ -297,7 +297,7 @@ fn sync_chain_removed(
let mut blocking_receive = Vec::new();
let mut blocking_bounce = Vec::new();
for id in removed {
- match rpc.get_tx_segwit_key(&id) {
+ match rpc.get_tx_segwit_key(id) {
Ok((full, key)) => {
// Valid tx are only problematic if not confirmed in the txs list and stored stored in the database
if txs
@@ -362,7 +362,7 @@ fn sync_chain_outgoing(
config: &Config,
) -> Result<(), Box<dyn std::error::Error>> {
match rpc
- .get_tx_op_return(&id)
+ .get_tx_op_return(id)
.map(|(full, bytes)| (full, decode_info(&bytes)))
{
Ok((full, Ok(info))) => match info {
@@ -496,7 +496,7 @@ fn sync_chain_incoming_confirmed(
rpc: &mut BtcRpc,
db: &mut Client,
) -> Result<(), Box<dyn std::error::Error>> {
- match rpc.get_tx_segwit_key(&id) {
+ match rpc.get_tx_segwit_key(id) {
Ok((full, reserve_pub)) => {
// Store transactions in database
let debit_addr = sender_address(rpc, &full)?;
diff --git a/btc-wire/src/taler_util.rs b/btc-wire/src/taler_util.rs
@@ -33,5 +33,5 @@ pub fn taler_to_btc(amount: &Amount) -> Result<BtcAmount, String> {
}
let sat = amount.value * 100_000_000 + amount.fraction as u64;
- return Ok(BtcAmount::from_sat(sat));
+ Ok(BtcAmount::from_sat(sat))
}
diff --git a/wire-gateway/src/main.rs b/wire-gateway/src/main.rs
@@ -105,7 +105,7 @@ async fn main() {
pool,
config: conf.clone(),
notify: Notify::new(),
- lifetime: conf.http_lifetime.map(|n| AtomicU64::new(n)),
+ lifetime: conf.http_lifetime.map(AtomicU64::new),
};
let state: &'static ServerState = Box::leak(Box::new(state));
let service = service_fn(move |req| async move {