1
1
use super :: Stream ;
2
- use futures:: executor;
3
- use futures:: io:: { AsyncRead , AsyncWrite } ;
4
- use futures:: prelude:: * ;
5
- use futures:: task:: { noop_waker_ref, Context } ;
2
+ use futures_executor:: block_on;
3
+ use futures_io:: { AsyncRead , AsyncWrite } ;
4
+ use futures_util:: io:: { AsyncReadExt , AsyncWriteExt } ;
5
+ use futures_util:: task:: { noop_waker_ref, Context } ;
6
+ use futures_util:: { future, ready} ;
6
7
use rustls:: internal:: pemfile:: { certs, rsa_private_keys} ;
7
8
use rustls:: { ClientConfig , ClientSession , NoClientAuth , ServerConfig , ServerSession , Session } ;
8
9
use std:: io:: { self , BufReader , Cursor , Read , Write } ;
@@ -105,7 +106,7 @@ fn stream_good() -> io::Result<()> {
105
106
Ok ( ( ) ) as io:: Result < ( ) >
106
107
} ;
107
108
108
- executor :: block_on ( fut)
109
+ block_on ( fut)
109
110
}
110
111
111
112
#[ test]
@@ -137,7 +138,7 @@ fn stream_bad() -> io::Result<()> {
137
138
Ok ( ( ) ) as io:: Result < ( ) >
138
139
} ;
139
140
140
- executor :: block_on ( fut)
141
+ block_on ( fut)
141
142
}
142
143
143
144
#[ test]
@@ -162,7 +163,7 @@ fn stream_handshake() -> io::Result<()> {
162
163
Ok ( ( ) ) as io:: Result < ( ) >
163
164
} ;
164
165
165
- executor :: block_on ( fut)
166
+ block_on ( fut)
166
167
}
167
168
168
169
#[ test]
@@ -183,7 +184,7 @@ fn stream_handshake_eof() -> io::Result<()> {
183
184
Ok ( ( ) ) as io:: Result < ( ) >
184
185
} ;
185
186
186
- executor :: block_on ( fut)
187
+ block_on ( fut)
187
188
}
188
189
189
190
#[ test]
@@ -202,7 +203,7 @@ fn stream_eof() -> io::Result<()> {
202
203
Ok ( ( ) ) as io:: Result < ( ) >
203
204
} ;
204
205
205
- executor :: block_on ( fut)
206
+ block_on ( fut)
206
207
}
207
208
208
209
fn make_pair ( ) -> ( ServerSession , ClientSession ) {
@@ -234,11 +235,11 @@ fn do_handshake(
234
235
let mut stream = Stream :: new ( & mut good, client) ;
235
236
236
237
if stream. session . is_handshaking ( ) {
237
- futures :: ready!( stream. complete_io( cx) ) ?;
238
+ ready ! ( stream. complete_io( cx) ) ?;
238
239
}
239
240
240
241
if stream. session . wants_write ( ) {
241
- futures :: ready!( stream. complete_io( cx) ) ?;
242
+ ready ! ( stream. complete_io( cx) ) ?;
242
243
}
243
244
244
245
Poll :: Ready ( Ok ( ( ) ) )
0 commit comments