@@ -9,14 +9,14 @@ use http::{Request, Response};
9
9
use httparse:: ParserConfig ;
10
10
use tokio:: io:: { AsyncRead , AsyncWrite } ;
11
11
12
- use crate :: body:: { Body , Incoming as IncomingBody } ;
13
12
use super :: super :: dispatch;
13
+ use crate :: body:: { Body , Incoming as IncomingBody } ;
14
14
use crate :: common:: {
15
15
exec:: { BoxSendFuture , Exec } ,
16
16
task, Future , Pin , Poll ,
17
17
} ;
18
18
use crate :: proto;
19
- use crate :: rt:: { Executor } ;
19
+ use crate :: rt:: Executor ;
20
20
use crate :: upgrade:: Upgraded ;
21
21
22
22
type Dispatcher < T , B > =
@@ -47,7 +47,6 @@ pub struct Parts<T> {
47
47
_inner : ( ) ,
48
48
}
49
49
50
-
51
50
/// A future that processes all HTTP state for the IO object.
52
51
///
53
52
/// In most cases, this should just be spawned into an executor, so that it
91
90
/// and [`try_ready!`](https://docs.rs/futures/0.1.25/futures/macro.try_ready.html)
92
91
/// to work with this function; or use the `without_shutdown` wrapper.
93
92
pub fn poll_without_shutdown ( & mut self , cx : & mut task:: Context < ' _ > ) -> Poll < crate :: Result < ( ) > > {
94
- self . inner . as_mut ( ) . expect ( "algready upgraded" ) . poll_without_shutdown ( cx)
93
+ self . inner
94
+ . as_mut ( )
95
+ . expect ( "algready upgraded" )
96
+ . poll_without_shutdown ( cx)
95
97
}
96
98
}
97
99
@@ -116,9 +118,7 @@ pub struct Builder {
116
118
///
117
119
/// This is a shortcut for `Builder::new().handshake(io)`.
118
120
/// See [`client::conn`](crate::client::conn) for more.
119
- pub async fn handshake < T , B > (
120
- io : T ,
121
- ) -> crate :: Result < ( SendRequest < B > , Connection < T , B > ) >
121
+ pub async fn handshake < T , B > ( io : T ) -> crate :: Result < ( SendRequest < B > , Connection < T , B > ) >
122
122
where
123
123
T : AsyncRead + AsyncWrite + Unpin + Send + ' static ,
124
124
B : Body + ' static ,
@@ -302,7 +302,7 @@ impl Builder {
302
302
}
303
303
}
304
304
305
- /// Provide an executor to execute background HTTP2 tasks.
305
+ /// Provide an executor to execute background HTTP1 tasks.
306
306
pub fn executor < E > ( & mut self , exec : E ) -> & mut Builder
307
307
where
308
308
E : Executor < BoxSendFuture > + Send + Sync + ' static ,
@@ -399,10 +399,7 @@ impl Builder {
399
399
/// Note that this setting does not affect HTTP/2.
400
400
///
401
401
/// Default is false.
402
- pub fn http1_ignore_invalid_headers_in_responses (
403
- & mut self ,
404
- enabled : bool ,
405
- ) -> & mut Builder {
402
+ pub fn http1_ignore_invalid_headers_in_responses ( & mut self , enabled : bool ) -> & mut Builder {
406
403
self . h1_parser_config
407
404
. ignore_invalid_headers_in_responses ( enabled) ;
408
405
self
0 commit comments