diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 79bdfebec9..7a182537a0 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -45,7 +45,7 @@ pub type SlotSlice<'s, T> = &'s [(Slot, T)]; pub type RefCount = u64; pub type AccountMap = InMemAccountsIndex; -type AccountMapEntry = Arc>; +pub(crate) type AccountMapEntry = Arc>; pub trait IsCached: 'static + Clone + Debug + PartialEq + ZeroLamport + Copy + Default { fn is_cached(&self) -> bool; @@ -756,7 +756,7 @@ pub trait ZeroLamport { fn is_zero_lamport(&self) -> bool; } -type MapType = AccountMap>; +type MapType = AccountMap; type LockMapType = Vec>>; type LockMapTypeSlice = [RwLock>]; type AccountMapsWriteLock<'a, T> = RwLockWriteGuard<'a, MapType>; diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index c2d359029f..8227d7c891 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -1,3 +1,4 @@ +use crate::accounts_index::{AccountMapEntry, IsCached}; use solana_sdk::pubkey::Pubkey; use std::collections::{ hash_map::{Entry, Iter, Keys}, @@ -9,31 +10,31 @@ type K = Pubkey; // one instance of this represents one bin of the accounts index. #[derive(Debug, Default)] -pub struct InMemAccountsIndex { +pub struct InMemAccountsIndex { // backing store - map: HashMap, + map: HashMap>, } -impl InMemAccountsIndex { +impl InMemAccountsIndex { pub fn new() -> Self { Self { map: HashMap::new(), } } - pub fn entry(&mut self, pubkey: Pubkey) -> Entry { + pub fn entry(&mut self, pubkey: Pubkey) -> Entry> { self.map.entry(pubkey) } - pub fn iter(&self) -> Iter { + pub fn iter(&self) -> Iter> { self.map.iter() } - pub fn keys(&self) -> Keys { + pub fn keys(&self) -> Keys> { self.map.keys() } - pub fn get(&self, key: &K) -> Option<&V> { + pub fn get(&self, key: &K) -> Option<&AccountMapEntry> { self.map.get(key) }