1
- use std:: cell:: Cell ;
2
1
use std:: future:: Future ;
3
2
use std:: pin:: Pin ;
4
3
use std:: sync:: Arc ;
@@ -7,7 +6,7 @@ use std::task::{Context, Poll};
7
6
use pin_project_lite:: pin_project;
8
7
9
8
use crate :: io;
10
- use crate :: task:: { self , JoinHandle , Task , TaskLocalsWrapper } ;
9
+ use crate :: task:: { JoinHandle , Task , TaskLocalsWrapper } ;
11
10
12
11
/// Task builder that configures the settings of a new task.
13
12
#[ derive( Debug , Default ) ]
@@ -61,7 +60,7 @@ impl Builder {
61
60
} ) ;
62
61
63
62
let task = wrapped. tag . task ( ) . clone ( ) ;
64
- let handle = task:: executor:: spawn ( wrapped) ;
63
+ let handle = crate :: task:: executor:: spawn ( wrapped) ;
65
64
66
65
Ok ( JoinHandle :: new ( handle, task) )
67
66
}
@@ -81,7 +80,7 @@ impl Builder {
81
80
} ) ;
82
81
83
82
let task = wrapped. tag . task ( ) . clone ( ) ;
84
- let handle = task:: executor:: local ( wrapped) ;
83
+ let handle = crate :: task:: executor:: local ( wrapped) ;
85
84
86
85
Ok ( JoinHandle :: new ( handle, task) )
87
86
}
@@ -143,6 +142,8 @@ impl Builder {
143
142
where
144
143
F : Future < Output = T > ,
145
144
{
145
+ use std:: cell:: Cell ;
146
+
146
147
let wrapped = self . build ( future) ;
147
148
148
149
// Log this `block_on` operation.
@@ -167,7 +168,7 @@ impl Builder {
167
168
TaskLocalsWrapper :: set_current ( & wrapped. tag , || {
168
169
let res = if should_run {
169
170
// The first call should run the executor
170
- task:: executor:: run ( wrapped)
171
+ crate :: task:: executor:: run ( wrapped)
171
172
} else {
172
173
futures_lite:: future:: block_on ( wrapped)
173
174
} ;
0 commit comments