Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/iddqd/src/bi_hash_map/ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ impl<'a, T: BiHashItem, S: Clone + BuildHasher> RefMut<'a, T, S> {
let inner = self.inner.take().unwrap();
inner.into_ref()
}
/// Opt-out of the change-detection provided by [`RefMut`].
///
/// It is a logic error to alter [`T::K1`](BiHashItem::K1)
/// or [`T::K2`](BiHashItem::K2) of the returned item.
pub fn into_mut_unchecked(mut self) -> &'a mut T {
self.inner.take().unwrap().borrowed
}
}

impl<T: BiHashItem, S: Clone + BuildHasher> Drop for RefMut<'_, T, S> {
Expand Down
6 changes: 6 additions & 0 deletions crates/iddqd/src/id_hash_map/ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ impl<'a, T: IdHashItem, S: Clone + BuildHasher> RefMut<'a, T, S> {
let inner = self.inner.take().unwrap();
inner.into_ref()
}
/// Opt-out of the change-detection provided by [`RefMut`].
///
/// It is a logic error to alter [`T::Key`](IdHashItem::Key) of the returned item.
pub fn into_mut_unchecked(mut self) -> &'a mut T {
self.inner.take().unwrap().borrowed
}
}

impl<T: IdHashItem, S: Clone + BuildHasher> Drop for RefMut<'_, T, S> {
Expand Down
7 changes: 7 additions & 0 deletions crates/iddqd/src/id_ord_map/ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ where
let inner = self.inner.take().unwrap();
inner.into_ref()
}

/// Opt-out of the change-detection provided by [`RefMut`].
///
/// It is a logic error to alter [`T::Key`](IdOrdItem::Key) of the returned item.
pub fn into_mut_unchecked(mut self) -> &'a mut T {
self.inner.take().unwrap().borrowed
}
}

impl<'a, T: for<'k> IdOrdItemMut<'k>> RefMut<'a, T> {
Expand Down
7 changes: 7 additions & 0 deletions crates/iddqd/src/tri_hash_map/ref_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ impl<'a, T: TriHashItem, S: Clone + BuildHasher> RefMut<'a, T, S> {
let inner = self.inner.take().unwrap();
inner.into_ref()
}
/// Opt-out of the change-detection provided by [`RefMut`].
///
/// It is a logic error to alter [`T::K1`](TriHashItem::K1), [`T::K2`](TriHashItem::K2),
/// or [`T::K3`](TriHashItem::K3) of the returned item.
pub fn into_mut_unchecked(mut self) -> &'a mut T {
self.inner.take().unwrap().borrowed
}
}

impl<T: TriHashItem, S: Clone + BuildHasher> Drop for RefMut<'_, T, S> {
Expand Down
Loading