File tree Expand file tree Collapse file tree 4 files changed +7
-13
lines changed Expand file tree Collapse file tree 4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1- use lazy_static :: lazy_static ;
1+ use once_cell :: sync :: Lazy ;
22use std:: io:: Write as StdWrite ;
33use std:: pin:: Pin ;
44use std:: sync:: Mutex ;
@@ -120,9 +120,7 @@ impl Stderr {
120120 /// # Ok(()) }) }
121121 /// ```
122122 pub async fn lock ( & self ) -> StderrLock < ' static > {
123- lazy_static ! {
124- static ref STDERR : std:: io:: Stderr = std:: io:: stderr( ) ;
125- }
123+ static STDERR : Lazy < std:: io:: Stderr > = Lazy :: new ( || std:: io:: stderr ( ) ) ;
126124
127125 blocking:: spawn ( move || StderrLock ( STDERR . lock ( ) ) ) . await
128126 }
Original file line number Diff line number Diff line change 1- use lazy_static :: lazy_static ;
1+ use once_cell :: sync :: Lazy ;
22use std:: pin:: Pin ;
33use std:: sync:: Mutex ;
44
@@ -176,9 +176,7 @@ impl Stdin {
176176 /// # Ok(()) }) }
177177 /// ```
178178 pub async fn lock ( & self ) -> StdinLock < ' static > {
179- lazy_static ! {
180- static ref STDIN : std:: io:: Stdin = std:: io:: stdin( ) ;
181- }
179+ static STDIN : Lazy < std:: io:: Stdin > = Lazy :: new ( || std:: io:: stdin ( ) ) ;
182180
183181 blocking:: spawn ( move || StdinLock ( STDIN . lock ( ) ) ) . await
184182 }
Original file line number Diff line number Diff line change 1- use lazy_static :: lazy_static ;
1+ use once_cell :: sync :: Lazy ;
22use std:: io:: Write as StdWrite ;
33use std:: pin:: Pin ;
44use std:: sync:: Mutex ;
@@ -120,9 +120,7 @@ impl Stdout {
120120 /// # Ok(()) }) }
121121 /// ```
122122 pub async fn lock ( & self ) -> StdoutLock < ' static > {
123- lazy_static ! {
124- static ref STDOUT : std:: io:: Stdout = std:: io:: stdout( ) ;
125- }
123+ static STDOUT : Lazy < std:: io:: Stdout > = Lazy :: new ( || std:: io:: stdout ( ) ) ;
126124
127125 blocking:: spawn ( move || StdoutLock ( STDOUT . lock ( ) ) ) . await
128126 }
Original file line number Diff line number Diff line change 1+ use std:: cmp:: { Ord , Ordering } ;
12use std:: marker:: PhantomData ;
2- use std:: cmp:: { Ordering , Ord } ;
33use std:: pin:: Pin ;
44
55use pin_project_lite:: pin_project;
You can’t perform that action at this time.
0 commit comments