@@ -21,10 +21,8 @@ pub(crate) struct Cached<T: Clone, S: UnmanagedSignal<T, SR>, SR: SignalsRuntime
2121) ;
2222
2323pub ( crate ) struct CachedGuard < ' a , T : ?Sized > ( RwLockReadGuard < ' a , T > ) ;
24- pub ( crate ) struct CachedGuardExclusive < ' a , T : ?Sized > ( RwLockWriteGuard < ' a , T > ) ;
2524
2625impl < ' a , T : ?Sized > Guard < T > for CachedGuard < ' a , T > { }
27- impl < ' a , T : ?Sized > Guard < T > for CachedGuardExclusive < ' a , T > { }
2826
2927impl < ' a , T : ?Sized > Deref for CachedGuard < ' a , T > {
3028 type Target = T ;
@@ -34,26 +32,12 @@ impl<'a, T: ?Sized> Deref for CachedGuard<'a, T> {
3432 }
3533}
3634
37- impl < ' a , T : ?Sized > Deref for CachedGuardExclusive < ' a , T > {
38- type Target = T ;
39-
40- fn deref ( & self ) -> & Self :: Target {
41- self . 0 . deref ( )
42- }
43- }
44-
4535impl < ' a , T : ?Sized > Borrow < T > for CachedGuard < ' a , T > {
4636 fn borrow ( & self ) -> & T {
4737 self . 0 . borrow ( )
4838 }
4939}
5040
51- impl < ' a , T : ?Sized > Borrow < T > for CachedGuardExclusive < ' a , T > {
52- fn borrow ( & self ) -> & T {
53- self . 0 . borrow ( )
54- }
55- }
56-
5741impl < T : Clone , S : UnmanagedSignal < T , SR > , SR : SignalsRuntimeRef > Cached < T , S , SR > {
5842 pub ( crate ) fn new ( source : S ) -> Self {
5943 let runtime = source. clone_runtime_ref ( ) ;
@@ -87,7 +71,7 @@ impl<T: Clone, S: UnmanagedSignal<T, SR>, SR: SignalsRuntimeRef>
8771 cache : Pin < & ForceSyncUnpin < RwLock < T > > > ,
8872 ) -> Propagation {
8973 //FIXME: This can be split up to avoid congestion where not necessary.
90- let new_value = source. project_ref ( ) . 0 . get_clone_exclusive ( ) ;
74+ let new_value = source. project_ref ( ) . 0 . get_clone ( ) ;
9175 * cache. project_ref ( ) . 0 . write ( ) . unwrap ( ) = new_value;
9276 Propagation :: Propagate
9377 }
@@ -115,7 +99,7 @@ impl<T: Clone, S: UnmanagedSignal<T, SR>, SR: SignalsRuntimeRef> Cached<T, S, SR
11599 ) -> Token < ' a > {
116100 cache. write ( ForceSyncUnpin (
117101 //FIXME: This can be split up to avoid congestion where not necessary.
118- source. project_ref ( ) . 0 . get_clone_exclusive ( ) . into ( ) ,
102+ source. project_ref ( ) . 0 . get_clone ( ) . into ( ) ,
119103 ) )
120104 }
121105}
0 commit comments