File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
use async_h1:: client;
2
2
use async_std:: { io, net, task} ;
3
- use http_types:: { HttpVersion , Method , Request , Url } ;
3
+ use http_types:: { Method , Request , Url } ;
4
4
5
5
fn main ( ) -> Result < ( ) , async_h1:: Exception > {
6
6
task:: block_on ( async {
@@ -11,12 +11,8 @@ fn main() -> Result<(), async_h1::Exception> {
11
11
for i in 0usize ..2 {
12
12
println ! ( "making request {}/2" , i + 1 ) ;
13
13
14
- let mut req = client:: encode ( Request :: new (
15
- HttpVersion :: HTTP1_1 ,
16
- Method :: Get ,
17
- Url :: parse ( "/foo" ) . unwrap ( ) ,
18
- ) )
19
- . await ?;
14
+ let mut req =
15
+ client:: encode ( Request :: new ( Method :: Get , Url :: parse ( "/foo" ) . unwrap ( ) ) ) . await ?;
20
16
io:: copy ( & mut req, & mut stream. clone ( ) ) . await ?;
21
17
22
18
// read the response
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use async_h1::server;
2
2
use async_std:: net;
3
3
use async_std:: prelude:: * ;
4
4
use async_std:: task;
5
- use http_types:: { HttpVersion , Response , StatusCode } ;
5
+ use http_types:: { Response , StatusCode } ;
6
6
7
7
fn main ( ) -> Result < ( ) , async_h1:: Exception > {
8
8
task:: block_on ( async {
@@ -17,7 +17,7 @@ fn main() -> Result<(), async_h1::Exception> {
17
17
18
18
let stream = Stream :: new ( stream) ;
19
19
server:: connect ( stream. clone ( ) , stream, |_| {
20
- async { Ok ( Response :: new ( HttpVersion :: HTTP1_1 , StatusCode :: Ok ) ) }
20
+ async { Ok ( Response :: new ( StatusCode :: Ok ) ) }
21
21
} )
22
22
. await
23
23
} ) ;
You can’t perform that action at this time.
0 commit comments