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

@@ -113,7 +113,7 @@ impl ResolvedDb {
let end = i + 32;
if signing[start .. end] == plan {
found = true;
signing = [&signing[.. start], &signing[end ..]].concat().to_vec();
signing = [&signing[.. start], &signing[end ..]].concat();
break;
}
}

View File

@@ -198,12 +198,12 @@ impl<D: Db, N: Network> MultisigManager<D, N> {
(
MultisigManager {
scanner,
existing: current_keys.first().cloned().map(|(activation_block, key)| MultisigViewer {
existing: current_keys.first().copied().map(|(activation_block, key)| MultisigViewer {
activation_block,
key,
scheduler: schedulers.remove(0),
}),
new: current_keys.get(1).cloned().map(|(activation_block, key)| MultisigViewer {
new: current_keys.get(1).copied().map(|(activation_block, key)| MultisigViewer {
activation_block,
key,
scheduler: schedulers.remove(0),

View File

@@ -484,7 +484,7 @@ impl<N: Network, D: Db> Scanner<N, D> {
let needing_ack = {
let scanner_lock = scanner_hold.read().await;
let scanner = scanner_lock.as_ref().unwrap();
scanner.need_ack.front().cloned()
scanner.need_ack.front().copied()
};
if let Some(needing_ack) = needing_ack {

View File

@@ -197,7 +197,6 @@ impl<N: Network> Scheduler<N> {
let mut add_plan = |payments| {
let amount = payment_amounts(&payments);
#[allow(clippy::unwrap_or_default)]
self.queued_plans.entry(amount).or_insert(VecDeque::new()).push_back(payments);
amount
};
@@ -474,7 +473,7 @@ impl<N: Network> Scheduler<N> {
let per_payment = to_amortize / payments_len;
let mut overage = to_amortize % payments_len;
for payment in payments.iter_mut() {
for payment in &mut payments {
let to_subtract = per_payment + overage;
// Only subtract the overage once
overage = 0;
@@ -499,7 +498,6 @@ impl<N: Network> Scheduler<N> {
return;
}
#[allow(clippy::unwrap_or_default)]
self.plans.entry(actual).or_insert(VecDeque::new()).push_back(payments);
// TODO2: This shows how ridiculous the serialize function is