From 82cb61dc362035089cefb00b08e9896287d4675f Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Wed, 2 Mar 2022 23:49:11 +0300 Subject: [PATCH] Add Copy/Eq derive traits to SlotStatus in accountsdb-plugin (#23100) * Add copy/eq derive traits to SlotStatus in accountsdb-plugin * move Eq to derive * remove not required clone --- .../src/accountsdb_plugin_interface.rs | 6 ++---- accountsdb-plugin-manager/src/slot_status_notifier.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/accountsdb-plugin-interface/src/accountsdb_plugin_interface.rs b/accountsdb-plugin-interface/src/accountsdb_plugin_interface.rs index e767d864a2..34270843c2 100644 --- a/accountsdb-plugin-interface/src/accountsdb_plugin_interface.rs +++ b/accountsdb-plugin-interface/src/accountsdb_plugin_interface.rs @@ -9,9 +9,7 @@ use { thiserror::Error, }; -impl Eq for ReplicaAccountInfo<'_> {} - -#[derive(Clone, PartialEq, Debug)] +#[derive(Debug, Clone, PartialEq, Eq)] /// Information about an account being updated pub struct ReplicaAccountInfo<'a> { /// The Pubkey for the account @@ -112,7 +110,7 @@ pub enum AccountsDbPluginError { } /// The current status of a slot -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum SlotStatus { /// The highest slot of the heaviest fork processed by the node. Ledger state at this slot is /// not derived from a confirmed or finalized block, but if multiple forks are present, is from diff --git a/accountsdb-plugin-manager/src/slot_status_notifier.rs b/accountsdb-plugin-manager/src/slot_status_notifier.rs index f1cc298dd7..16251e92a9 100644 --- a/accountsdb-plugin-manager/src/slot_status_notifier.rs +++ b/accountsdb-plugin-manager/src/slot_status_notifier.rs @@ -52,7 +52,7 @@ impl SlotStatusNotifierImpl { for plugin in plugin_manager.plugins.iter_mut() { let mut measure = Measure::start("accountsdb-plugin-update-slot"); - match plugin.update_slot_status(slot, parent, slot_status.clone()) { + match plugin.update_slot_status(slot, parent, slot_status) { Err(err) => { error!( "Failed to update slot status at slot {}, error: {} to plugin {}",