@@ -2,7 +2,7 @@ mod test_utils;
2
2
3
3
use std:: io:: { Read , Write } ;
4
4
use std:: net:: { SocketAddr , TcpListener } ;
5
- use std:: pin:: Pin ;
5
+ use std:: pin:: { pin , Pin } ;
6
6
use std:: sync:: atomic:: Ordering ;
7
7
use std:: sync:: Arc ;
8
8
use std:: task:: Poll ;
@@ -143,8 +143,7 @@ async fn drop_client_closes_idle_connections() {
143
143
drop ( client) ;
144
144
145
145
// and wait a few ticks for the connections to close
146
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
147
- futures_util:: pin_mut!( t) ;
146
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
148
147
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
149
148
future:: select ( t, close) . await ;
150
149
t1. await . unwrap ( ) ;
@@ -193,8 +192,7 @@ async fn drop_response_future_closes_in_progress_connection() {
193
192
future:: select ( res, rx1) . await ;
194
193
195
194
// res now dropped
196
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
197
- futures_util:: pin_mut!( t) ;
195
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
198
196
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
199
197
future:: select ( t, close) . await ;
200
198
}
@@ -249,8 +247,7 @@ async fn drop_response_body_closes_in_progress_connection() {
249
247
res. unwrap ( ) ;
250
248
251
249
// and wait a few ticks to see the connection drop
252
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
253
- futures_util:: pin_mut!( t) ;
250
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
254
251
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
255
252
future:: select ( t, close) . await ;
256
253
}
@@ -302,8 +299,7 @@ async fn no_keep_alive_closes_connection() {
302
299
let ( res, _) = future:: join ( res, rx) . await ;
303
300
res. unwrap ( ) ;
304
301
305
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
306
- futures_util:: pin_mut!( t) ;
302
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
307
303
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
308
304
future:: select ( close, t) . await ;
309
305
}
@@ -349,8 +345,7 @@ async fn socket_disconnect_closes_idle_conn() {
349
345
let ( res, _) = future:: join ( res, rx) . await ;
350
346
res. unwrap ( ) ;
351
347
352
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
353
- futures_util:: pin_mut!( t) ;
348
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
354
349
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
355
350
future:: select ( t, close) . await ;
356
351
}
@@ -572,8 +567,7 @@ async fn client_keep_alive_when_response_before_request_body_ends() {
572
567
assert_eq ! ( connects. load( Ordering :: Relaxed ) , 1 ) ;
573
568
574
569
drop ( client) ;
575
- let t = tokio:: time:: sleep ( Duration :: from_millis ( 100 ) ) . map ( |_| panic ! ( "time out" ) ) ;
576
- futures_util:: pin_mut!( t) ;
570
+ let t = pin ! ( tokio:: time:: sleep( Duration :: from_millis( 100 ) ) . map( |_| panic!( "time out" ) ) ) ;
577
571
let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
578
572
future:: select ( t, close) . await ;
579
573
}
0 commit comments