1313//! features = ["unstable-streams"] 
1414//! ``` 
1515
16+ use  std:: cell:: OnceCell ; 
1617use  std:: ops:: Deref ; 
18+ use  std:: sync:: OnceLock ; 
1719use  std:: { future:: Future ,  pin:: Pin ,  sync:: Mutex } ; 
1820
1921use  :: tokio:: { 
2022    runtime:: { Builder ,  Runtime } , 
2123    task, 
2224} ; 
23- use  once_cell:: { 
24-     sync:: { Lazy ,  OnceCell } , 
25-     unsync:: OnceCell  as  UnsyncOnceCell , 
26- } ; 
25+ use  once_cell:: sync:: Lazy ; 
2726use  pyo3:: prelude:: * ; 
2827
2928use  crate :: { 
@@ -66,7 +65,7 @@ impl Deref for Pyo3Runtime {
6665} 
6766
6867static  TOKIO_BUILDER :  Lazy < Mutex < Builder > >  = Lazy :: new ( || Mutex :: new ( multi_thread ( ) ) ) ; 
69- static  TOKIO_RUNTIME :  OnceCell < Pyo3Runtime >  = OnceCell :: new ( ) ; 
68+ static  TOKIO_RUNTIME :  OnceLock < Pyo3Runtime >  = OnceLock :: new ( ) ; 
7069
7170impl  generic:: JoinError  for  task:: JoinError  { 
7271    fn  is_panic ( & self )  -> bool  { 
@@ -80,7 +79,7 @@ impl generic::JoinError for task::JoinError {
8079struct  TokioRuntime ; 
8180
8281tokio:: task_local! { 
83-     static  TASK_LOCALS :  UnsyncOnceCell <TaskLocals >; 
82+     static  TASK_LOCALS :  OnceCell <TaskLocals >; 
8483} 
8584
8685impl  GenericRuntime  for  TokioRuntime  { 
@@ -102,7 +101,7 @@ impl ContextExt for TokioRuntime {
102101    where 
103102        F :  Future < Output  = R >  + Send  + ' static , 
104103    { 
105-         let  cell = UnsyncOnceCell :: new ( ) ; 
104+         let  cell = OnceCell :: new ( ) ; 
106105        cell. set ( locals) . unwrap ( ) ; 
107106
108107        Box :: pin ( TASK_LOCALS . scope ( cell,  fut) ) 
@@ -132,7 +131,7 @@ impl LocalContextExt for TokioRuntime {
132131    where 
133132        F :  Future < Output  = R >  + ' static , 
134133    { 
135-         let  cell = UnsyncOnceCell :: new ( ) ; 
134+         let  cell = OnceCell :: new ( ) ; 
136135        cell. set ( locals) . unwrap ( ) ; 
137136
138137        Box :: pin ( TASK_LOCALS . scope ( cell,  fut) ) 
0 commit comments