Skip to content

Commit c95ce37

Browse files
committed
Remove futures-util dependency
1 parent 4618d6e commit c95ce37

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ readme = "README.md"
1111
edition = "2018"
1212

1313
[dependencies]
14-
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
1514
hex = "0.4"
1615
hyper = "0.14"
1716
tokio = { version = "1.0", features = ["net"] }

src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use futures_util::future::BoxFuture;
21
use hex::FromHex;
32
use hyper::{
43
client::connect::{Connected, Connection},
@@ -8,6 +7,7 @@ use hyper::{
87
use pin_project_lite::pin_project;
98
use std::{
109
io,
10+
future::Future,
1111
path::{Path, PathBuf},
1212
pin::Pin,
1313
task::{Context, Poll},
@@ -81,7 +81,7 @@ impl Unpin for UnixConnector {}
8181
impl Service<Uri> for UnixConnector {
8282
type Response = UnixStream;
8383
type Error = std::io::Error;
84-
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
84+
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;
8585
fn call(&mut self, req: Uri) -> Self::Future {
8686
let fut = async move {
8787
let path = parse_socket_path(req)?;

src/server.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use hyper::server::{Builder, Server};
55
use conn::SocketIncoming;
66

77
pub(crate) mod conn {
8-
use futures_util::ready;
98
use hyper::server::accept::Accept;
109
use pin_project_lite::pin_project;
1110
use std::{
@@ -51,8 +50,8 @@ pub(crate) mod conn {
5150
self: Pin<&mut Self>,
5251
cx: &mut Context<'_>,
5352
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
54-
let conn = ready!(self.listener.poll_accept(cx))?.0;
55-
Poll::Ready(Some(Ok(conn)))
53+
self.listener.poll_accept(cx)?
54+
.map(|(conn, _)| Some(Ok(conn)))
5655
}
5756
}
5857

0 commit comments

Comments
 (0)