diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 8b57a6076c4cce..ba222f7a66ba06 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -63,7 +63,7 @@ pub struct AccountMapEntryInner { #[self_referencing] pub struct ReadAccountMapEntry { - pub owned_entry: Arc>, + pub owned_entry: AccountMapEntry, #[borrows(owned_entry)] pub slot_list_guard: RwLockReadGuard<'this, SlotList>, } @@ -71,7 +71,7 @@ pub struct ReadAccountMapEntry { impl ReadAccountMapEntry { pub fn from_account_map_entry(account_map_entry: AccountMapEntry) -> Self { ReadAccountMapEntryBuilder { - owned_entry: Arc::new(account_map_entry), + owned_entry: account_map_entry, slot_list_guard_builder: |lock| lock.slot_list.read().unwrap(), } .build() @@ -88,7 +88,7 @@ impl ReadAccountMapEntry { #[self_referencing] pub struct WriteAccountMapEntry { - pub owned_entry: Arc>, + pub owned_entry: AccountMapEntry, #[borrows(owned_entry)] pub slot_list_guard: RwLockWriteGuard<'this, SlotList>, } @@ -96,7 +96,7 @@ pub struct WriteAccountMapEntry { impl WriteAccountMapEntry { pub fn from_account_map_entry(account_map_entry: AccountMapEntry) -> Self { WriteAccountMapEntryBuilder { - owned_entry: Arc::new(account_map_entry), + owned_entry: account_map_entry, slot_list_guard_builder: |lock| lock.slot_list.write().unwrap(), } .build()