mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Clippyfy (#6341)
* Add clippy config and remove .cargo from gitignore * first fixes * Clippyfied * Add clippy CI job * comment out rusty-cachier * minor * fix ci * remove DAG from check-dependent-project * add DAG to clippy Co-authored-by: alvicsam <alvicsam@gmail.com>
This commit is contained in:
@@ -282,8 +282,8 @@ impl State {
|
||||
|
||||
/// Constructs an infinite iterator from an array of `TrancheEntry` values. Any missing tranches
|
||||
/// are filled with empty assignments, as they are needed to compute the approved tranches.
|
||||
fn filled_tranche_iterator<'a>(
|
||||
tranches: &'a [TrancheEntry],
|
||||
fn filled_tranche_iterator(
|
||||
tranches: &[TrancheEntry],
|
||||
) -> impl Iterator<Item = (DelayTranche, &[(ValidatorIndex, Tick)])> {
|
||||
let mut gap_end = None;
|
||||
|
||||
|
||||
@@ -155,10 +155,10 @@ impl<'a> From<&'a SessionInfo> for Config {
|
||||
Config {
|
||||
assignment_keys: s.assignment_keys.clone(),
|
||||
validator_groups: s.validator_groups.clone(),
|
||||
n_cores: s.n_cores.clone(),
|
||||
zeroth_delay_tranche_width: s.zeroth_delay_tranche_width.clone(),
|
||||
relay_vrf_modulo_samples: s.relay_vrf_modulo_samples.clone(),
|
||||
n_delay_tranches: s.n_delay_tranches.clone(),
|
||||
n_cores: s.n_cores,
|
||||
zeroth_delay_tranche_width: s.zeroth_delay_tranche_width,
|
||||
relay_vrf_modulo_samples: s.relay_vrf_modulo_samples,
|
||||
n_delay_tranches: s.n_delay_tranches,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,11 +415,8 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
|
||||
Err(error) => {
|
||||
// It's possible that we've lost a race with finality.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx.send_message(ChainApiMessage::FinalizedBlockHash(
|
||||
block_header.number.clone(),
|
||||
tx,
|
||||
))
|
||||
.await;
|
||||
ctx.send_message(ChainApiMessage::FinalizedBlockHash(block_header.number, tx))
|
||||
.await;
|
||||
|
||||
let lost_to_finality = match rx.await {
|
||||
Ok(Ok(Some(h))) if h != block_hash => true,
|
||||
|
||||
@@ -621,10 +621,7 @@ impl CurrentlyCheckingSet {
|
||||
.candidate_hash_map
|
||||
.remove(&approval_state.candidate_hash)
|
||||
.unwrap_or_default();
|
||||
approvals_cache.put(
|
||||
approval_state.candidate_hash.clone(),
|
||||
approval_state.approval_outcome.clone(),
|
||||
);
|
||||
approvals_cache.put(approval_state.candidate_hash, approval_state.approval_outcome);
|
||||
return (out, approval_state)
|
||||
}
|
||||
}
|
||||
@@ -768,7 +765,7 @@ async fn run<B, Context>(
|
||||
where
|
||||
B: Backend,
|
||||
{
|
||||
if let Err(err) = db_sanity_check(subsystem.db.clone(), subsystem.db_config.clone()) {
|
||||
if let Err(err) = db_sanity_check(subsystem.db.clone(), subsystem.db_config) {
|
||||
gum::warn!(target: LOG_TARGET, ?err, "Could not run approval vote DB sanity check");
|
||||
}
|
||||
|
||||
@@ -1278,7 +1275,7 @@ async fn get_approval_signatures_for_candidate<Context>(
|
||||
Some(e) => e,
|
||||
};
|
||||
|
||||
let relay_hashes = entry.block_assignments.iter().map(|(relay_hash, _)| relay_hash);
|
||||
let relay_hashes = entry.block_assignments.keys();
|
||||
|
||||
let mut candidate_indices = HashSet::new();
|
||||
// Retrieve `CoreIndices`/`CandidateIndices` as required by approval-distribution:
|
||||
@@ -2502,7 +2499,7 @@ async fn issue_approval<Context>(
|
||||
};
|
||||
|
||||
let candidate_hash = match block_entry.candidate(candidate_index as usize) {
|
||||
Some((_, h)) => h.clone(),
|
||||
Some((_, h)) => *h,
|
||||
None => {
|
||||
gum::warn!(
|
||||
target: LOG_TARGET,
|
||||
|
||||
Reference in New Issue
Block a user