diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index f3fcca8f4..f0d2cbe9c 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -113,10 +113,10 @@ impl AccountMapEntryInner { } } -pub enum AccountIndexGetResult<'a, T: 'static, U> { +pub enum AccountIndexGetResult<'a, T: 'static> { Found(ReadAccountMapEntry, usize), NotFoundOnFork, - Missing(std::sync::RwLockReadGuard<'a, AccountMap>>), + Missing(AccountMapsReadLock<'a, T>), } #[self_referencing] @@ -509,6 +509,7 @@ pub trait ZeroLamport { type MapType = AccountMap>; type AccountMapsWriteLock<'a, T> = RwLockWriteGuard<'a, AccountMap>>; +type AccountMapsReadLock<'a, T> = RwLockReadGuard<'a, AccountMap>>; #[derive(Debug)] pub struct AccountsIndex { @@ -1084,7 +1085,7 @@ impl AccountsIndex { pubkey: &Pubkey, ancestors: Option<&Ancestors>, max_root: Option, - ) -> AccountIndexGetResult<'_, T, Pubkey> { + ) -> AccountIndexGetResult<'_, T> { let read_lock = self.account_maps.read().unwrap(); let account = read_lock .get(pubkey) @@ -1550,7 +1551,7 @@ pub mod tests { } } - impl<'a, T: 'static, U> AccountIndexGetResult<'a, T, U> { + impl<'a, T: 'static> AccountIndexGetResult<'a, T> { pub fn unwrap(self) -> (ReadAccountMapEntry, usize) { match self { AccountIndexGetResult::Found(lock, size) => (lock, size),