Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Oct 16, 2020
1 parent f7e03b7 commit 66e67f3
Showing 1 changed file with 1 addition and 35 deletions.
36 changes: 1 addition & 35 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,11 @@ use std::{
btree_map::{self, BTreeMap},
HashMap, HashSet,
},
ops::{Deref, DerefMut, Range, RangeBounds},
ops::{Range, RangeBounds},
sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard},
};
const ITER_BATCH_SIZE: usize = 1000;

#[self_referencing]
pub struct OwningReadGuard<T: 'static> {
lock: Arc<RwLock<T>>,
#[borrows(lock)]
pub guard: RwLockReadGuard<'this, T>,
}

impl<T> Deref for OwningReadGuard<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&*self.guard
}
}

#[self_referencing]
pub struct OwningWriteGuard<T: 'static> {
lock: Arc<RwLock<T>>,
#[borrows(lock)]
pub guard: RwLockWriteGuard<'this, T>,
}

impl<T> Deref for OwningWriteGuard<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&*self.guard
}
}

impl<T> DerefMut for OwningWriteGuard<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut *self.guard
}
}

pub type SlotList<T> = Vec<(Slot, T)>;
pub type SlotSlice<'s, T> = &'s [(Slot, T)];
pub type Ancestors = HashMap<Slot, usize>;
Expand Down

0 comments on commit 66e67f3

Please sign in to comment.