Fix builds.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Helper module which defines the [`Any`] trait to to allow dynamic value handling.
|
||||
|
||||
use crate::fn_native::SendSync;
|
||||
use crate::fn_native::{shared_write_lock, SendSync};
|
||||
use crate::r#unsafe::{unsafe_cast_box, unsafe_try_cast};
|
||||
use crate::{FnPtr, ImmutableString, INT};
|
||||
#[cfg(feature = "no_std")]
|
||||
@@ -283,14 +283,11 @@ enum DynamicWriteLockInner<'d, T: Clone> {
|
||||
/// A simple mutable reference to a non-shared value.
|
||||
Reference(&'d mut T),
|
||||
|
||||
/// A write guard to a shared [`RefCell`][std::cell::RefCell].
|
||||
/// A write guard to a shared value.
|
||||
///
|
||||
/// Not available under `no_closure`.
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
#[cfg(not(feature = "sync"))]
|
||||
Guard(std::cell::RefMut<'d, Dynamic>),
|
||||
/// A write guard to a shared [`RwLock`][std::sync::RwLock].
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
#[cfg(feature = "sync")]
|
||||
Guard(std::sync::RwLockWriteGuard<'d, Dynamic>),
|
||||
Guard(crate::fn_native::LockGuard<'d, Dynamic>),
|
||||
}
|
||||
|
||||
impl<'d, T: Any + Clone> Deref for DynamicWriteLock<'d, T> {
|
||||
@@ -1593,10 +1590,7 @@ impl Dynamic {
|
||||
match self.0 {
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
Union::Shared(ref cell, _, _) => {
|
||||
#[cfg(not(feature = "sync"))]
|
||||
let value = cell.borrow_mut();
|
||||
#[cfg(feature = "sync")]
|
||||
let value = cell.write().unwrap();
|
||||
let value = shared_write_lock(cell);
|
||||
|
||||
if (*value).type_id() != TypeId::of::<T>()
|
||||
&& TypeId::of::<Dynamic>() != TypeId::of::<T>()
|
||||
|
Reference in New Issue
Block a user