Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeizer committed Nov 25, 2022
1 parent d6aea60 commit 72c84ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 4 additions & 7 deletions src/rt/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ pub(super) struct Store<T = Entry> {
id: StoreId,
}


#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
#[cfg_attr(feature = "checkpoint", derive(Serialize, Deserialize))]
pub(super) struct StoreId(usize);


pub(super) trait Object: Sized {
type Entry;

Expand Down Expand Up @@ -222,9 +220,9 @@ impl<T> Store<T> {
})
}

pub(super) fn iter_mut<'a, O>(&'a mut self) -> impl DoubleEndedIterator<Item=&mut O>
where
O: Object<Entry=T> + 'a,
pub(super) fn iter_mut<'a, O>(&'a mut self) -> impl DoubleEndedIterator<Item = &mut O>
where
O: Object<Entry = T> + 'a,
{
self.entries.iter_mut().filter_map(O::get_mut)
}
Expand Down Expand Up @@ -316,8 +314,7 @@ impl<T: Object> Ref<T> {
/// Panic if the reference belongs to a different store
fn assert_store_id(self, store: &Store<T::Entry>) {
assert_eq!(
self.store_id,
store.id,
self.store_id, store.id,
"Tried to access an object using a reference that belongs to a different store. \
This might indicate you are trying to reuse an object from an earlier execution"
)
Expand Down
4 changes: 2 additions & 2 deletions tests/cell_reuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ thread_local! {
}

#[test]
#[should_panic="Tried to access an object using a reference that belongs to a different store. This might indicate you are trying to reuse an object from an earlier execution"]
#[should_panic = "Tried to access an object using a reference that belongs to a different store. This might indicate you are trying to reuse an object from an earlier execution"]
fn test_cell_reuse() {
loom::model(|| {
let handle_a = loom::thread::spawn(|| {
Expand All @@ -17,4 +17,4 @@ fn test_cell_reuse() {
handle_a.join().unwrap();
handle_b.join().unwrap();
});
}
}

0 comments on commit 72c84ec

Please sign in to comment.