mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 10:35:48 +00:00
simplify some pattern matches to appease 1.68 clippy (#13833)
This commit is contained in:
@@ -502,10 +502,10 @@ where
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
use ElectionError::*;
|
||||
match (self, other) {
|
||||
(&Feasibility(ref x), &Feasibility(ref y)) if x == y => true,
|
||||
(&Miner(ref x), &Miner(ref y)) if x == y => true,
|
||||
(&DataProvider(ref x), &DataProvider(ref y)) if x == y => true,
|
||||
(&Fallback(ref x), &Fallback(ref y)) if x == y => true,
|
||||
(Feasibility(x), Feasibility(y)) if x == y => true,
|
||||
(Miner(x), Miner(y)) if x == y => true,
|
||||
(DataProvider(x), DataProvider(y)) if x == y => true,
|
||||
(Fallback(x), Fallback(y)) if x == y => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ impl<T: Config, O: Offence<T::IdentificationTuple>> ReportIndexStorage<T, O> {
|
||||
fn insert(&mut self, time_slot: &O::TimeSlot, report_id: ReportIdOf<T>) {
|
||||
// Insert the report id into the list while maintaining the ordering by the time
|
||||
// slot.
|
||||
let pos = self.same_kind_reports.partition_point(|&(ref when, _)| when <= time_slot);
|
||||
let pos = self.same_kind_reports.partition_point(|(when, _)| when <= time_slot);
|
||||
self.same_kind_reports.insert(pos, (time_slot.clone(), report_id));
|
||||
|
||||
// Update the list of concurrent reports.
|
||||
|
||||
@@ -678,7 +678,7 @@ impl<T: Config> Pallet<T> {
|
||||
// since a new validator set always leads to `changed` starting
|
||||
// as true, we can ensure that `now_session_keys` and `next_validators`
|
||||
// have the same length. this function is called once per iteration.
|
||||
if let Some(&(_, ref old_keys)) = now_session_keys.next() {
|
||||
if let Some((_, old_keys)) = now_session_keys.next() {
|
||||
if old_keys != keys {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
@@ -1299,8 +1299,8 @@ where
|
||||
add_db_reads_writes(1, 0);
|
||||
|
||||
// Reverse because it's more likely to find reports from recent eras.
|
||||
match eras.iter().rev().find(|&&(_, ref sesh)| sesh <= &slash_session) {
|
||||
Some(&(ref slash_era, _)) => *slash_era,
|
||||
match eras.iter().rev().find(|&(_, sesh)| sesh <= &slash_session) {
|
||||
Some((slash_era, _)) => *slash_era,
|
||||
// Before bonding period. defensive - should be filtered out.
|
||||
None => return consumed_weight,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user