Skip to content

Commit

Permalink
Add Send and Sync for hash_table::OccupiedEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Sep 22, 2023
1 parent b31e883 commit 142e536
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,19 @@ where
table: &'a mut RawTable<T, A>,
}

unsafe impl<T, A> Send for OccupiedEntry<'_, T, A>
where
T: Send,
A: Send + Allocator,
{
}
unsafe impl<T, A> Sync for OccupiedEntry<'_, T, A>
where
T: Sync,
A: Sync + Allocator,
{
}

impl<T: fmt::Debug, A: Allocator> fmt::Debug for OccupiedEntry<'_, T, A> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedEntry")
Expand Down

0 comments on commit 142e536

Please sign in to comment.