File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ use hyper::service::service_fn;
10
10
use hyper:: { Request , Response } ;
11
11
use tokio:: net:: TcpListener ;
12
12
13
+ // This would normally come from the `hyper-util` crate, but we can't depend
14
+ // on that here because it would be a cyclical dependency.
13
15
#[ path = "../benches/support/mod.rs" ]
14
16
mod support;
15
- use support:: TokioIo ;
17
+ use support:: { TokioIo , TokioTimer } ;
16
18
17
19
// An async function that consumes a request, does nothing with it and returns a
18
20
// response.
19
- async fn hello ( _: Request < hyper:: body:: Incoming > ) -> Result < Response < Full < Bytes > > , Infallible > {
21
+ async fn hello ( _: Request < impl hyper:: body:: Body > ) -> Result < Response < Full < Bytes > > , Infallible > {
20
22
Ok ( Response :: new ( Full :: new ( Bytes :: from ( "Hello World!" ) ) ) )
21
23
}
22
24
@@ -51,6 +53,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
51
53
// Handle the connection from the client using HTTP1 and pass any
52
54
// HTTP requests received on that connection to the `hello` function
53
55
if let Err ( err) = http1:: Builder :: new ( )
56
+ . timer ( TokioTimer )
54
57
. serve_connection ( io, service_fn ( hello) )
55
58
. await
56
59
{
You can’t perform that action at this time.
0 commit comments