@@ -2,7 +2,7 @@ mod test_utils;
22
33use std:: io:: { Read , Write } ;
44use std:: net:: { SocketAddr , TcpListener } ;
5- use std:: pin:: Pin ;
5+ use std:: pin:: { pin , Pin } ;
66use std:: sync:: atomic:: Ordering ;
77use std:: sync:: Arc ;
88use std:: task:: Poll ;
@@ -143,8 +143,7 @@ async fn drop_client_closes_idle_connections() {
143143 drop ( client) ;
144144
145145 // 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" ) ) ) ;
148147 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
149148 future:: select ( t, close) . await ;
150149 t1. await . unwrap ( ) ;
@@ -193,8 +192,7 @@ async fn drop_response_future_closes_in_progress_connection() {
193192 future:: select ( res, rx1) . await ;
194193
195194 // 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" ) ) ) ;
198196 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
199197 future:: select ( t, close) . await ;
200198}
@@ -249,8 +247,7 @@ async fn drop_response_body_closes_in_progress_connection() {
249247 res. unwrap ( ) ;
250248
251249 // 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" ) ) ) ;
254251 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
255252 future:: select ( t, close) . await ;
256253}
@@ -302,8 +299,7 @@ async fn no_keep_alive_closes_connection() {
302299 let ( res, _) = future:: join ( res, rx) . await ;
303300 res. unwrap ( ) ;
304301
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" ) ) ) ;
307303 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
308304 future:: select ( close, t) . await ;
309305}
@@ -349,8 +345,7 @@ async fn socket_disconnect_closes_idle_conn() {
349345 let ( res, _) = future:: join ( res, rx) . await ;
350346 res. unwrap ( ) ;
351347
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" ) ) ) ;
354349 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
355350 future:: select ( t, close) . await ;
356351}
@@ -572,8 +567,7 @@ async fn client_keep_alive_when_response_before_request_body_ends() {
572567 assert_eq ! ( connects. load( Ordering :: Relaxed ) , 1 ) ;
573568
574569 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" ) ) ) ;
577571 let close = closes. into_future ( ) . map ( |( opt, _) | opt. expect ( "closes" ) ) ;
578572 future:: select ( t, close) . await ;
579573}
0 commit comments