File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ const CACHE_CAP: usize = 128;
1313static mut CACHE : Lazy < LruCache < CacheKey , Rc < dyn Any > > > =
1414 Lazy :: new ( || LruCache :: new ( NonZeroUsize :: new ( CACHE_CAP ) . unwrap ( ) ) ) ;
1515
16- pub ( crate ) fn touch < T : ' static > ( key : & ' static dyn Observable ) -> Option < Rc < T > > {
16+ pub ( crate ) fn touch < T > ( key : & ' static dyn Observable ) -> Option < Rc < T > >
17+ where
18+ T : ' static ,
19+ {
1720 // When the Effect performs dependency calculations for the first time,
1821 // it must ignore the relevant cache,
1922 // otherwise the underlying Signal will not remember the Effect.
@@ -28,7 +31,10 @@ pub(crate) fn touch<T: 'static>(key: &'static dyn Observable) -> Option<Rc<T>> {
2831 . map ( |rc| unsafe { Rc :: from_raw ( Rc :: into_raw ( rc) as * const T ) } )
2932}
3033
31- pub ( crate ) fn store_in_cache < T : ' static > ( key : & ' static dyn Observable , val : T ) -> Rc < T > {
34+ pub ( crate ) fn store_in_cache < T > ( key : & ' static dyn Observable , val : T ) -> Rc < T >
35+ where
36+ T : ' static ,
37+ {
3238 let rc = Rc :: new ( val) ;
3339 unsafe { CACHE . put ( key, Rc :: clone ( & rc) as _ ) } ;
3440 rc
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ pub fn memo(_attr: TokenStream, item: TokenStream) -> TokenStream {
183183 static mut #ident: #ty = #expr;
184184
185185 #vis #sig
186- where #output_ty: Clone + ' static
186+ where #output_ty: Clone
187187 {
188188 unsafe { ( * #ident) . get( ) }
189189 }
You can’t perform that action at this time.
0 commit comments