Skip to content

Commit

Permalink
Reduce futures dependency to component crates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudy committed Dec 28, 2023
1 parent 4f7ebff commit 1bc6f84
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 53 deletions.
40 changes: 2 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ braid = { path = "./braid" }

bytes = "1"
camino = { version = "1" }
futures = "^0.3"
futures = "0.3"
futures-core = "0.3"
futures-util = "0.3"
http = { version = "1" }
http-body = { version = "1" }
http-body-util = { version = "0.1" }
Expand Down
5 changes: 3 additions & 2 deletions braid/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
camino.workspace = true
futures.workspace = true
futures-core.workspace = true
http.workspace = true
hyper = { workspace = true, features = ["full"] }
pin-project.workspace = true
Expand All @@ -19,6 +19,7 @@ tower.workspace = true
tracing.workspace = true

[dev-dependencies]
futures-util.workspace = true
pem-rfc7468 = { version = "0.7", features = ["alloc"] }
tokio = { version = "1", features = ["macros"] }
tempfile = "3"
tokio = { version = "1", features = ["macros"] }
2 changes: 1 addition & 1 deletion braid/src/duplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Accept for DuplexIncoming {
}
}

impl futures::Stream for DuplexIncoming {
impl futures_core::Stream for DuplexIncoming {
type Item = Result<DuplexStream, io::Error>;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Expand Down
2 changes: 1 addition & 1 deletion braid/src/server/acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Accept for Acceptor {
}
}

impl futures::Stream for Acceptor {
impl futures_core::Stream for Acceptor {
type Item = Result<Stream, io::Error>;

fn poll_next(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
Expand Down
2 changes: 1 addition & 1 deletion braid/src/server/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
task::Poll,
};

use futures::future::BoxFuture;
use futures_core::future::BoxFuture;
use hyper::{Request, Response};
use tower::{Layer, Service};
use tracing::{dispatcher, Instrument};
Expand Down
4 changes: 2 additions & 2 deletions braid/src/tls/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::sync::Arc;
use std::{fmt, io};
use std::{future::Future, pin::Pin};

use futures::future::BoxFuture;
use futures::ready;
use futures_core::future::BoxFuture;
use futures_core::ready;
use hyper::client::connect::Connection;
use hyper::client::HttpConnector;
use hyper::Uri;
Expand Down
2 changes: 1 addition & 1 deletion braid/src/tls/server/acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::task::{Context, Poll};
use std::pin::Pin;
use std::{io, sync::Arc};

use futures::ready;
use futures_core::ready;
use hyper::server::accept::Accept;
use hyper::server::conn::AddrIncoming;
use pin_project::pin_project;
Expand Down
2 changes: 1 addition & 1 deletion braid/src/tls/server/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
task::Poll,
};

use futures::future::BoxFuture;
use futures_core::future::BoxFuture;
use hyper::{Request, Response};
use tower::{Layer, Service};
use tracing::{dispatcher, Instrument};
Expand Down
2 changes: 1 addition & 1 deletion braid/src/tls/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::task::{Context, Poll};
use std::{fmt, io};
use std::{future::Future, pin::Pin};

use futures::ready;
use futures_core::ready;
use hyper::server::conn::AddrStream;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
use tokio_rustls::Accept;
Expand Down
2 changes: 1 addition & 1 deletion braid/tests/duplex.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[tokio::test]
async fn braided_duplex() {
use futures::StreamExt;
use futures_util::StreamExt;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

let (client, incoming) = braid::duplex::DuplexClient::new("test".parse().unwrap());
Expand Down
2 changes: 1 addition & 1 deletion braid/tests/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::net::Ipv4Addr;

#[tokio::test]
async fn braided_tcp() {
use futures::StreamExt;
use futures_util::StreamExt;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

let incoming =
Expand Down
2 changes: 1 addition & 1 deletion braid/tests/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn tls_root_store() -> rustls::RootCertStore {

#[tokio::test]
async fn braided_tls() {
use futures::StreamExt;
use futures_util::StreamExt;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

let incoming =
Expand Down
2 changes: 1 addition & 1 deletion braid/tests/unix.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[tokio::test]
async fn braided_unix() {
use futures::StreamExt;
use futures_util::StreamExt;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

let dir = tempfile::tempdir().unwrap();
Expand Down

0 comments on commit 1bc6f84

Please sign in to comment.