File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
2
use std:: time:: Duration ;
3
3
4
- use hyper:: { Client , body:: HttpBody as _} ;
4
+ use hyper:: { body:: HttpBody as _, Client } ;
5
5
use tokio:: io:: { self , AsyncWriteExt as _} ;
6
6
7
7
use hyper:: client:: HttpConnector ;
@@ -38,9 +38,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
38
38
39
39
while let Some ( chunk) = res. body_mut ( ) . data ( ) . await {
40
40
let chunk = chunk?;
41
- io:: stdout ( )
42
- . write_all ( & chunk)
43
- . await ?
41
+ io:: stdout ( ) . write_all ( & chunk) . await ?
44
42
}
45
43
Ok ( ( ) )
46
44
}
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ use tokio::io::{AsyncRead, AsyncWrite};
7
7
use tokio:: time:: { timeout, Duration } ;
8
8
use tokio_io_timeout:: TimeoutStream ;
9
9
10
- use hyper:: { service:: Service , Uri } ;
11
10
use hyper:: client:: connect:: { Connect , Connected , Connection } ;
11
+ use hyper:: { service:: Service , Uri } ;
12
12
13
13
mod stream;
14
14
78
78
let timeout = timeout ( connect_timeout, connecting) ;
79
79
80
80
let fut = async move {
81
- let connecting = timeout. await . map_err ( |e| io:: Error :: new ( io:: ErrorKind :: TimedOut , e) ) ?;
81
+ let connecting = timeout
82
+ . await
83
+ . map_err ( |e| io:: Error :: new ( io:: ErrorKind :: TimedOut , e) ) ?;
82
84
let io = connecting. map_err ( Into :: into) ?;
83
85
84
86
let mut tm = TimeoutConnectorStream :: new ( TimeoutStream :: new ( io) ) ;
@@ -132,8 +134,8 @@ mod tests {
132
134
use std:: io;
133
135
use std:: time:: Duration ;
134
136
135
- use hyper:: Client ;
136
137
use hyper:: client:: HttpConnector ;
138
+ use hyper:: Client ;
137
139
138
140
use super :: TimeoutConnector ;
139
141
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::io;
2
2
use std:: io:: IoSlice ;
3
3
use std:: pin:: Pin ;
4
4
use std:: task:: { Context , Poll } ;
5
- use std:: time:: { Duration } ;
5
+ use std:: time:: Duration ;
6
6
7
7
use hyper:: client:: connect:: { Connected , Connection } ;
8
8
use pin_project_lite:: pin_project;
You can’t perform that action at this time.
0 commit comments