Skip to content

Commit 2999411

Browse files
committed
Format code according to rustfmt
1 parent 63a8097 commit 2999411

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/client.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::env;
22
use std::time::Duration;
33

4-
use hyper::{Client, body::HttpBody as _};
4+
use hyper::{body::HttpBody as _, Client};
55
use tokio::io::{self, AsyncWriteExt as _};
66

77
use hyper::client::HttpConnector;
@@ -38,9 +38,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
3838

3939
while let Some(chunk) = res.body_mut().data().await {
4040
let chunk = chunk?;
41-
io::stdout()
42-
.write_all(&chunk)
43-
.await?
41+
io::stdout().write_all(&chunk).await?
4442
}
4543
Ok(())
4644
}

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use tokio::io::{AsyncRead, AsyncWrite};
77
use tokio::time::{timeout, Duration};
88
use tokio_io_timeout::TimeoutStream;
99

10-
use hyper::{service::Service, Uri};
1110
use hyper::client::connect::{Connect, Connected, Connection};
11+
use hyper::{service::Service, Uri};
1212

1313
mod stream;
1414

@@ -78,7 +78,9 @@ where
7878
let timeout = timeout(connect_timeout, connecting);
7979

8080
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))?;
8284
let io = connecting.map_err(Into::into)?;
8385

8486
let mut tm = TimeoutConnectorStream::new(TimeoutStream::new(io));
@@ -132,8 +134,8 @@ mod tests {
132134
use std::io;
133135
use std::time::Duration;
134136

135-
use hyper::Client;
136137
use hyper::client::HttpConnector;
138+
use hyper::Client;
137139

138140
use super::TimeoutConnector;
139141

src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::io;
22
use std::io::IoSlice;
33
use std::pin::Pin;
44
use std::task::{Context, Poll};
5-
use std::time::{Duration};
5+
use std::time::Duration;
66

77
use hyper::client::connect::{Connected, Connection};
88
use pin_project_lite::pin_project;

0 commit comments

Comments
 (0)