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;
5
5
pub ( crate ) static GLOBAL_EXECUTOR : Executor < ' _ > = Executor :: new ( ) ;
6
6
7
7
thread_local ! {
8
- pub ( crate ) static LOCAL_EXECUTOR : LocalExecutor <' static > = LocalExecutor :: new( ) ;
8
+ pub ( crate ) static LOCAL_EXECUTOR : LocalExecutor <' static > = const { LocalExecutor :: new( ) } ;
9
9
}
10
10
11
11
/// 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);
13
13
thread_local ! {
14
14
// Used to shutdown a thread when we receive a message from the Sender.
15
15
// 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( ) } ;
17
17
}
18
18
19
19
/// Spawn more executor threads, up to configured max value.
@@ -84,7 +84,7 @@ fn thread_main_loop() {
84
84
85
85
// Main loop
86
86
loop {
87
- #[ allow( clippy:: blocks_in_if_conditions ) ]
87
+ #[ allow( clippy:: blocks_in_conditions ) ]
88
88
if std:: panic:: catch_unwind ( || {
89
89
crate :: executor:: LOCAL_EXECUTOR . with ( |executor| {
90
90
let local = executor. run ( async {
@@ -111,7 +111,7 @@ fn thread_main_loop() {
111
111
112
112
fn wait_for_local_executor_completion ( ) {
113
113
loop {
114
- #[ allow( clippy:: blocks_in_if_conditions ) ]
114
+ #[ allow( clippy:: blocks_in_conditions ) ]
115
115
if std:: panic:: catch_unwind ( || {
116
116
crate :: executor:: LOCAL_EXECUTOR . with ( |executor| {
117
117
crate :: reactor:: block_on ( async {
You can’t perform that action at this time.
0 commit comments