Skip to content

Commit

Permalink
Remove Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Oct 16, 2020
1 parent 970b2c7 commit 125f10a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ pub struct AccountMapEntryInner<T> {

#[self_referencing]
pub struct ReadAccountMapEntry<T: 'static> {
pub owned_entry: Arc<AccountMapEntry<T>>,
pub owned_entry: AccountMapEntry<T>,
#[borrows(owned_entry)]
pub slot_list_guard: RwLockReadGuard<'this, SlotList<T>>,
}

impl<T: Clone> ReadAccountMapEntry<T> {
pub fn from_account_map_entry(account_map_entry: AccountMapEntry<T>) -> 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()
Expand All @@ -88,15 +88,15 @@ impl<T: Clone> ReadAccountMapEntry<T> {

#[self_referencing]
pub struct WriteAccountMapEntry<T: 'static> {
pub owned_entry: Arc<AccountMapEntry<T>>,
pub owned_entry: AccountMapEntry<T>,
#[borrows(owned_entry)]
pub slot_list_guard: RwLockWriteGuard<'this, SlotList<T>>,
}

impl<T: 'static + Clone> WriteAccountMapEntry<T> {
pub fn from_account_map_entry(account_map_entry: AccountMapEntry<T>) -> 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()
Expand Down

0 comments on commit 125f10a

Please sign in to comment.