Skip to content

Commit

Permalink
pacify the merciless cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Aug 20, 2024
1 parent 8ad967e commit 02036ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/function/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ where
let zalsa = db.zalsa();
let memo_guard = self.get_memo_from_table_for(zalsa, id);
if let Some(memo) = &memo_guard {
if memo.value.is_some() && self.shallow_verify_memo(db, zalsa, self.database_key_index(id), memo) {
if memo.value.is_some()
&& self.shallow_verify_memo(db, zalsa, self.database_key_index(id), memo)
{
let value = unsafe {
// Unsafety invariant: memo is present in memo_map
self.extend_memo_lifetime(memo).unwrap()
Expand Down
12 changes: 7 additions & 5 deletions src/table/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,13 @@ impl MemoTable {
arc_swap: ArcSwap::new(Self::to_dummy(memo)),
}),
);
old_entry.map(|MemoEntryData {
type_id: _,
to_dyn_fn: _,
arc_swap,
}| unsafe { Self::from_dummy(arc_swap.into_inner()) })
old_entry.map(
|MemoEntryData {
type_id: _,
to_dyn_fn: _,
arc_swap,
}| unsafe { Self::from_dummy(arc_swap.into_inner()) },
)
}

pub(crate) fn get<M: Memo>(
Expand Down

0 comments on commit 02036ff

Please sign in to comment.