Skip to content

Commit

Permalink
Fix compile error in non-send mode
Browse files Browse the repository at this point in the history
  • Loading branch information
khvzak committed Sep 20, 2024
1 parent da4404b commit 640d276
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/userdata/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,15 @@ impl<T: 'static> UserDataStorage<T> {
}
}

#[allow(unused)]
#[inline(always)]
pub(crate) fn try_borrow(&self) -> Result<UserDataBorrowRef<T>> {
match self {
Self::Owned(data) => data.try_borrow(),
Self::Scoped(_) => Err(Error::UserDataTypeMismatch),
}
}

#[inline(always)]
pub(crate) fn try_borrow_mut(&self) -> Result<UserDataBorrowMut<T>> {
match self {
Expand Down

0 comments on commit 640d276

Please sign in to comment.