Fix compile error in non-send mode

This commit is contained in:
Alex Orlenko
2024-09-20 21:20:52 +01:00
parent da4404baa5
commit 640d27697d
+9
View File
@@ -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 {