@@ -18,12 +18,12 @@ use futures::future::{self, Either, Executor};
18
18
use h2;
19
19
use tokio_io:: { AsyncRead , AsyncWrite } ;
20
20
21
- use body:: Payload ;
22
- use common:: Exec ;
23
- use upgrade:: Upgraded ;
24
- use proto;
21
+ use crate :: body:: Payload ;
22
+ use crate :: common:: Exec ;
23
+ use crate :: upgrade:: Upgraded ;
24
+ use crate :: proto;
25
25
use super :: dispatch;
26
- use { Body , Request , Response } ;
26
+ use crate :: { Body , Request , Response } ;
27
27
28
28
type Http1Dispatcher < T , B , R > = proto:: dispatch:: Dispatcher <
29
29
proto:: dispatch:: Client < B > ,
@@ -39,7 +39,7 @@ type ConnEither<T, B> = Either<
39
39
/// Returns a `Handshake` future over some IO.
40
40
///
41
41
/// This is a shortcut for `Builder::new().handshake(io)`.
42
- pub fn handshake < T > ( io : T ) -> Handshake < T , :: Body >
42
+ pub fn handshake < T > ( io : T ) -> Handshake < T , crate :: Body >
43
43
where
44
44
T : AsyncRead + AsyncWrite + Send + ' static ,
45
45
{
@@ -98,7 +98,7 @@ pub struct Handshake<T, B> {
98
98
pub struct ResponseFuture {
99
99
// for now, a Box is used to hide away the internal `B`
100
100
// that can be returned if canceled
101
- inner : Box < dyn Future < Item =Response < Body > , Error =:: Error > + Send > ,
101
+ inner : Box < dyn Future < Item =Response < Body > , Error =crate :: Error > + Send > ,
102
102
}
103
103
104
104
/// Deconstructed parts of a `Connection`.
@@ -145,7 +145,7 @@ impl<B> SendRequest<B>
145
145
/// Polls to determine whether this sender can be used yet for a request.
146
146
///
147
147
/// If the associated connection is closed, this returns an Error.
148
- pub fn poll_ready ( & mut self ) -> Poll < ( ) , :: Error > {
148
+ pub fn poll_ready ( & mut self ) -> Poll < ( ) , crate :: Error > {
149
149
self . dispatch . poll_ready ( )
150
150
}
151
151
@@ -235,7 +235,7 @@ where
235
235
} ,
236
236
Err ( _req) => {
237
237
debug ! ( "connection was not ready" ) ;
238
- let err = :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
238
+ let err = crate :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
239
239
Either :: B ( future:: err ( err) )
240
240
}
241
241
} ;
@@ -245,7 +245,7 @@ where
245
245
}
246
246
}
247
247
248
- pub ( crate ) fn send_request_retryable ( & mut self , req : Request < B > ) -> impl Future < Item = Response < Body > , Error = ( :: Error , Option < Request < B > > ) >
248
+ pub ( crate ) fn send_request_retryable ( & mut self , req : Request < B > ) -> impl Future < Item = Response < Body > , Error = ( crate :: Error , Option < Request < B > > ) >
249
249
where
250
250
B : Send ,
251
251
{
@@ -262,7 +262,7 @@ where
262
262
} ,
263
263
Err ( req) => {
264
264
debug ! ( "connection was not ready" ) ;
265
- let err = :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
265
+ let err = crate :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
266
266
Either :: B ( future:: err ( ( err, Some ( req) ) ) )
267
267
}
268
268
}
@@ -305,7 +305,7 @@ impl<B> Http2SendRequest<B>
305
305
where
306
306
B : Payload + ' static ,
307
307
{
308
- pub ( super ) fn send_request_retryable ( & mut self , req : Request < B > ) -> impl Future < Item =Response < Body > , Error =( :: Error , Option < Request < B > > ) >
308
+ pub ( super ) fn send_request_retryable ( & mut self , req : Request < B > ) -> impl Future < Item =Response < Body > , Error =( crate :: Error , Option < Request < B > > ) >
309
309
where
310
310
B : Send ,
311
311
{
@@ -322,7 +322,7 @@ where
322
322
} ,
323
323
Err ( req) => {
324
324
debug ! ( "connection was not ready" ) ;
325
- let err = :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
325
+ let err = crate :: Error :: new_canceled ( ) . with ( "connection was not ready" ) ;
326
326
Either :: B ( future:: err ( ( err, Some ( req) ) ) )
327
327
}
328
328
}
@@ -380,7 +380,7 @@ where
380
380
/// Use [`poll_fn`](https://docs.rs/futures/0.1.25/futures/future/fn.poll_fn.html)
381
381
/// and [`try_ready!`](https://docs.rs/futures/0.1.25/futures/macro.try_ready.html)
382
382
/// to work with this function; or use the `without_shutdown` wrapper.
383
- pub fn poll_without_shutdown ( & mut self ) -> Poll < ( ) , :: Error > {
383
+ pub fn poll_without_shutdown ( & mut self ) -> Poll < ( ) , crate :: Error > {
384
384
match self . inner . as_mut ( ) . expect ( "already upgraded" ) {
385
385
& mut Either :: A ( ref mut h1) => {
386
386
h1. poll_without_shutdown ( )
@@ -393,9 +393,9 @@ where
393
393
394
394
/// Prevent shutdown of the underlying IO object at the end of service the request,
395
395
/// instead run `into_parts`. This is a convenience wrapper over `poll_without_shutdown`.
396
- pub fn without_shutdown ( self ) -> impl Future < Item =Parts < T > , Error =:: Error > {
396
+ pub fn without_shutdown ( self ) -> impl Future < Item =Parts < T > , Error =crate :: Error > {
397
397
let mut conn = Some ( self ) ;
398
- :: futures:: future:: poll_fn ( move || -> :: Result < _ > {
398
+ :: futures:: future:: poll_fn ( move || -> crate :: Result < _ > {
399
399
try_ready ! ( conn. as_mut( ) . unwrap( ) . poll_without_shutdown( ) ) ;
400
400
Ok ( conn. take ( ) . unwrap ( ) . into_parts ( ) . into ( ) )
401
401
} )
@@ -408,7 +408,7 @@ where
408
408
B : Payload + ' static ,
409
409
{
410
410
type Item = ( ) ;
411
- type Error = :: Error ;
411
+ type Error = crate :: Error ;
412
412
413
413
fn poll ( & mut self ) -> Poll < Self :: Item , Self :: Error > {
414
414
match try_ready ! ( self . inner. poll( ) ) {
@@ -552,7 +552,7 @@ where
552
552
B : Payload + ' static ,
553
553
{
554
554
type Item = ( SendRequest < B > , Connection < T , B > ) ;
555
- type Error = :: Error ;
555
+ type Error = crate :: Error ;
556
556
557
557
fn poll ( & mut self ) -> Poll < Self :: Item , Self :: Error > {
558
558
let io = self . io . take ( ) . expect ( "polled more than once" ) ;
@@ -601,7 +601,7 @@ impl<T, B> fmt::Debug for Handshake<T, B> {
601
601
602
602
impl Future for ResponseFuture {
603
603
type Item = Response < Body > ;
604
- type Error = :: Error ;
604
+ type Error = crate :: Error ;
605
605
606
606
#[ inline]
607
607
fn poll ( & mut self ) -> Poll < Self :: Item , Self :: Error > {
@@ -620,7 +620,7 @@ impl fmt::Debug for ResponseFuture {
620
620
621
621
impl < B > Future for WhenReady < B > {
622
622
type Item = SendRequest < B > ;
623
- type Error = :: Error ;
623
+ type Error = crate :: Error ;
624
624
625
625
fn poll ( & mut self ) -> Poll < Self :: Item , Self :: Error > {
626
626
let mut tx = self . tx . take ( ) . expect ( "polled after complete" ) ;
0 commit comments