Skip to content

Commit 640d276

Browse files
committed
Fix compile error in non-send mode
1 parent da4404b commit 640d276

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/userdata/cell.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,15 @@ impl<T: 'static> UserDataStorage<T> {
412412
}
413413
}
414414

415+
#[allow(unused)]
416+
#[inline(always)]
417+
pub(crate) fn try_borrow(&self) -> Result<UserDataBorrowRef<T>> {
418+
match self {
419+
Self::Owned(data) => data.try_borrow(),
420+
Self::Scoped(_) => Err(Error::UserDataTypeMismatch),
421+
}
422+
}
423+
415424
#[inline(always)]
416425
pub(crate) fn try_borrow_mut(&self) -> Result<UserDataBorrowMut<T>> {
417426
match self {

0 commit comments

Comments
 (0)