Add checks for is_empty.

This commit is contained in:
Stephen Chung
2022-03-03 13:02:57 +08:00
parent 83755bf936
commit 0e9a16e437
18 changed files with 202 additions and 110 deletions

View File

@@ -206,14 +206,10 @@ enum DynamicReadLockInner<'d, T: Clone> {
/// A simple reference to a non-shared value.
Reference(&'d T),
/// A read guard to a shared [`RefCell`][std::cell::RefCell].
/// A read guard to a shared value.
#[cfg(not(feature = "no_closure"))]
#[cfg(not(feature = "sync"))]
Guard(std::cell::Ref<'d, Dynamic>),
/// A read guard to a shared [`RwLock`][std::sync::RwLock].
#[cfg(not(feature = "no_closure"))]
#[cfg(feature = "sync")]
Guard(std::sync::RwLockReadGuard<'d, Dynamic>),
Guard(crate::func::native::LockGuard<'d, Dynamic>),
}
impl<'d, T: Any + Clone> Deref for DynamicReadLock<'d, T> {
@@ -245,7 +241,7 @@ enum DynamicWriteLockInner<'d, T: Clone> {
/// A write guard to a shared value.
#[cfg(not(feature = "no_closure"))]
Guard(crate::func::native::LockGuard<'d, Dynamic>),
Guard(crate::func::native::LockGuardMut<'d, Dynamic>),
}
impl<'d, T: Any + Clone> Deref for DynamicWriteLock<'d, T> {