Add workspace lints

This commit is contained in:
Luke Parker
2023-12-16 20:54:24 -05:00
parent c40ce00955
commit ea3af28139
122 changed files with 329 additions and 128 deletions

View File

@@ -383,7 +383,7 @@ impl Bitcoin {
}
}
fees.sort();
let fee = fees.get(fees.len() / 2).cloned().unwrap_or(0);
let fee = fees.get(fees.len() / 2).copied().unwrap_or(0);
// The DUST constant documentation notes a relay rule practically enforcing a
// 1000 sat/kilo-vbyte minimum fee.

View File

@@ -285,7 +285,7 @@ impl Monero {
fees.push(tx.rct_signatures.base.fee / u64::try_from(tx.serialize().len()).unwrap());
}
fees.sort();
let fee = fees.get(fees.len() / 2).cloned().unwrap_or(0);
let fee = fees.get(fees.len() / 2).copied().unwrap_or(0);
// TODO: Set a sane minimum fee
Ok(Fee { per_weight: fee.max(1500000), mask: 10000 })
@@ -665,7 +665,7 @@ impl Network for Monero {
async fn publish_transaction(&self, tx: &Self::Transaction) -> Result<(), NetworkError> {
match self.rpc.publish_transaction(tx).await {
Ok(_) => Ok(()),
Ok(()) => Ok(()),
Err(RpcError::ConnectionError(e)) => {
log::debug!("Monero ConnectionError: {e}");
Err(NetworkError::ConnectionError)?