From b467e7fb3bd54e8ffc7b21b1a77915bfea21c60a Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Wed, 15 Sep 2021 09:54:16 -0500 Subject: [PATCH] AcctIdx: remove auto Debug trait (#19905) --- runtime/src/accounts_index_storage.rs | 9 ++++++++- runtime/src/bucket_map_holder.rs | 8 +++++++- runtime/src/in_mem_accounts_index.rs | 7 ++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/runtime/src/accounts_index_storage.rs b/runtime/src/accounts_index_storage.rs index 444c309100..f2ad251d9a 100644 --- a/runtime/src/accounts_index_storage.rs +++ b/runtime/src/accounts_index_storage.rs @@ -1,6 +1,7 @@ use crate::accounts_index::IndexValue; use crate::bucket_map_holder::BucketMapHolder; use crate::waitable_condvar::WaitableCondvar; +use std::fmt::Debug; use std::{ sync::{ atomic::{AtomicBool, Ordering}, @@ -14,7 +15,7 @@ use std::{ // When this instance is dropped, it will drop the bucket map and cleanup // and it will stop all the background threads and join them. -#[derive(Debug, Default)] +#[derive(Default)] pub struct AccountsIndexStorage { // for managing the bg threads exit: Arc, @@ -25,6 +26,12 @@ pub struct AccountsIndexStorage { storage: Arc>, } +impl Debug for AccountsIndexStorage { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + Ok(()) + } +} + impl Drop for AccountsIndexStorage { fn drop(&mut self) { self.exit.store(true, Ordering::Relaxed); diff --git a/runtime/src/bucket_map_holder.rs b/runtime/src/bucket_map_holder.rs index ef020905f4..4d78acf9e1 100644 --- a/runtime/src/bucket_map_holder.rs +++ b/runtime/src/bucket_map_holder.rs @@ -7,12 +7,18 @@ use std::sync::Arc; use std::time::Duration; // will eventually hold the bucket map -#[derive(Debug, Default)] +#[derive(Default)] pub struct BucketMapHolder { pub stats: BucketMapHolderStats, _phantom: std::marker::PhantomData, } +impl Debug for BucketMapHolder { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + Ok(()) + } +} + impl BucketMapHolder { pub fn new() -> Self { Self::default() diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index 1412ed5b25..5330d89612 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -15,7 +15,6 @@ use std::ops::RangeBounds; type K = Pubkey; // one instance of this represents one bin of the accounts index. -#[derive(Debug)] pub struct InMemAccountsIndex { // backing store map_internal: RwLock>>, @@ -23,6 +22,12 @@ pub struct InMemAccountsIndex { bin: usize, } +impl Debug for InMemAccountsIndex { + fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + Ok(()) + } +} + impl InMemAccountsIndex { pub fn new(storage: &AccountsIndexStorage, bin: usize) -> Self { Self {