File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::future::Future;
55pub ( crate ) static GLOBAL_EXECUTOR : Executor < ' _ > = Executor :: new ( ) ;
66
77thread_local ! {
8- pub ( crate ) static LOCAL_EXECUTOR : LocalExecutor <' static > = LocalExecutor :: new( ) ;
8+ pub ( crate ) static LOCAL_EXECUTOR : LocalExecutor <' static > = const { LocalExecutor :: new( ) } ;
99}
1010
1111/// Runs the global and the local executor on the current thread
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ static GLOBAL_EXECUTOR_EXPECTED_THREADS_NUMBER: Mutex<usize> = Mutex::new(0);
1313thread_local ! {
1414 // Used to shutdown a thread when we receive a message from the Sender.
1515 // We send an ack using to the Receiver once we're finished shutting down.
16- static THREAD_SHUTDOWN : OnceCell <( Sender <( ) >, Receiver <( ) >) > = OnceCell :: new( ) ;
16+ static THREAD_SHUTDOWN : OnceCell <( Sender <( ) >, Receiver <( ) >) > = const { OnceCell :: new( ) } ;
1717}
1818
1919/// Spawn more executor threads, up to configured max value.
@@ -84,7 +84,7 @@ fn thread_main_loop() {
8484
8585 // Main loop
8686 loop {
87- #[ allow( clippy:: blocks_in_if_conditions ) ]
87+ #[ allow( clippy:: blocks_in_conditions ) ]
8888 if std:: panic:: catch_unwind ( || {
8989 crate :: executor:: LOCAL_EXECUTOR . with ( |executor| {
9090 let local = executor. run ( async {
@@ -111,7 +111,7 @@ fn thread_main_loop() {
111111
112112fn wait_for_local_executor_completion ( ) {
113113 loop {
114- #[ allow( clippy:: blocks_in_if_conditions ) ]
114+ #[ allow( clippy:: blocks_in_conditions ) ]
115115 if std:: panic:: catch_unwind ( || {
116116 crate :: executor:: LOCAL_EXECUTOR . with ( |executor| {
117117 crate :: reactor:: block_on ( async {
You can’t perform that action at this time.
0 commit comments