Skip to content

Commit ac7a1cb

Browse files
committed
fmt
1 parent 458ad95 commit ac7a1cb

6 files changed

Lines changed: 12 additions & 13 deletions

File tree

src/client/http/connect/verbose.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ mod sealed {
8585
mut self: Pin<&mut Self>,
8686
cx: &mut Context,
8787
buf: &[u8],
88-
) -> Poll<Result<usize, std::io::Error>> {
88+
) -> Poll<io::Result<usize>> {
8989
match Pin::new(&mut self.inner).poll_write(cx, buf) {
9090
Poll::Ready(Ok(n)) => {
9191
trace!("{:08x} write: {:?}", self.id, Escape::new(&buf[..n]));
@@ -100,7 +100,7 @@ mod sealed {
100100
mut self: Pin<&mut Self>,
101101
cx: &mut Context<'_>,
102102
bufs: &[IoSlice<'_>],
103-
) -> Poll<Result<usize, io::Error>> {
103+
) -> Poll<io::Result<usize>> {
104104
match Pin::new(&mut self.inner).poll_write_vectored(cx, bufs) {
105105
Poll::Ready(Ok(nwritten)) => {
106106
trace!(

src/core/client/connect/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ impl ConnectingTcpRemote {
811811
Some(e) => Err(e),
812812
None => Err(ConnectError::new(
813813
"tcp connect error",
814-
std::io::Error::new(io::ErrorKind::NotConnected, "Network unreachable"),
814+
io::Error::new(io::ErrorKind::NotConnected, "Network unreachable"),
815815
)),
816816
}
817817
}

src/core/client/connect/proxy/tunnel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ where
233233
}
234234
}
235235

236-
async fn read<T>(io: &mut T, buf: &mut [u8]) -> Result<usize, std::io::Error>
236+
async fn read<T>(io: &mut T, buf: &mut [u8]) -> io::Result<usize>
237237
where
238238
T: AsyncRead + Unpin,
239239
{

src/core/client/connect/uds.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
io,
23
path::Path,
34
pin::Pin,
45
sync::Arc,
@@ -10,15 +11,15 @@ use tokio::net::UnixStream;
1011

1112
use super::{Connected, Connection};
1213

13-
type ConnectResult = Result<UnixStream, std::io::Error>;
14+
type ConnectResult = io::Result<UnixStream>;
1415
type BoxConnecting = Pin<Box<dyn Future<Output = ConnectResult> + Send>>;
1516

1617
#[derive(Clone)]
1718
pub struct UnixConnector(pub(crate) Arc<Path>);
1819

1920
impl tower::Service<Uri> for UnixConnector {
2021
type Response = UnixStream;
21-
type Error = std::io::Error;
22+
type Error = io::Error;
2223
type Future = BoxConnecting;
2324

2425
#[inline]
@@ -30,7 +31,7 @@ impl tower::Service<Uri> for UnixConnector {
3031
let fut = UnixStream::connect(self.0.clone());
3132
Box::pin(async move {
3233
let io = fut.await?;
33-
Ok::<_, std::io::Error>(io)
34+
Ok::<_, io::Error>(io)
3435
})
3536
}
3637
}

src/core/client/proto/h2/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ where
287287
return Poll::Ready(match e.reason() {
288288
Some(Reason::NO_ERROR) | Some(Reason::CANCEL) => Ok(()),
289289
Some(Reason::STREAM_CLOSED) => {
290-
Err(std::io::Error::new(io::ErrorKind::BrokenPipe, e))
290+
Err(io::Error::new(io::ErrorKind::BrokenPipe, e))
291291
}
292292
_ => Err(h2_to_io_error(e)),
293293
});
@@ -311,7 +311,7 @@ where
311311
mut self: Pin<&mut Self>,
312312
cx: &mut Context<'_>,
313313
buf: &[u8],
314-
) -> Poll<Result<usize, std::io::Error>> {
314+
) -> Poll<io::Result<usize>> {
315315
if buf.is_empty() {
316316
return Poll::Ready(Ok(0));
317317
}

tests/support/server.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{
2-
convert::Infallible, future::Future, net, sync::mpsc as std_mpsc, thread, time::Duration,
2+
convert::Infallible, future::Future, io, net, sync::mpsc as std_mpsc, thread, time::Duration,
33
};
44

55
use tokio::{io::AsyncReadExt, net::TcpStream, runtime, sync::oneshot};
@@ -205,9 +205,7 @@ where
205205
}
206206

207207
#[allow(unused)]
208-
async fn low_level_read_http_request(
209-
client_socket: &mut TcpStream,
210-
) -> core::result::Result<Vec<u8>, std::io::Error> {
208+
async fn low_level_read_http_request(client_socket: &mut TcpStream) -> io::Result<Vec<u8>> {
211209
let mut buf = Vec::new();
212210

213211
// Read until the delimiter "\r\n\r\n" is found

0 commit comments

Comments
 (0)