Skip to content

Commit e923921

Browse files
committed
Drop dependency on futures-channel
Tokio already provides mpsc and oneshot, and it is an unconditional dependency. Use those implementations and drop a superfluous dependency.
1 parent f9f8f44 commit e923921

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ tokio = { version = "1", features = ["sync"] }
2828
# Optional
2929

3030
atomic-waker = { version = "1.1.2", optional = true }
31-
futures-channel = { version = "0.3", optional = true }
3231
futures-core = { version = "0.3.31", optional = true }
3332
futures-util = { version = "0.3", default-features = false, features = ["alloc"], optional = true }
3433
h2 = { version = "0.4.2", optional = true }
@@ -44,7 +43,6 @@ want = { version = "0.3", optional = true }
4443

4544
[dev-dependencies]
4645
form_urlencoded = "1"
47-
futures-channel = { version = "0.3", features = ["sink"] }
4846
futures-util = { version = "0.3", default-features = false, features = ["alloc", "sink"] }
4947
http-body-util = "0.1"
5048
pretty_env_logger = "0.5"
@@ -80,8 +78,8 @@ full = [
8078
]
8179

8280
# HTTP versions
83-
http1 = ["dep:atomic-waker", "dep:futures-channel", "dep:futures-core", "dep:httparse", "dep:itoa", "dep:pin-utils"]
84-
http2 = ["dep:futures-channel", "dep:futures-core", "dep:h2"]
81+
http1 = ["dep:atomic-waker", "dep:futures-core", "dep:httparse", "dep:itoa", "dep:pin-utils"]
82+
http2 = ["dep:futures-core", "dep:h2"]
8583

8684
# Client/Server
8785
client = ["dep:want", "dep:pin-project-lite", "dep:smallvec"]

benches/end_to_end.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl Opts {
341341
let make_request = || {
342342
let chunk_cnt = self.request_chunks;
343343
let body = if chunk_cnt > 0 {
344-
let (mut tx, rx) = futures_channel::mpsc::channel(0);
344+
let (mut tx, rx) = tokio::sync::mpsc::channel(0);
345345

346346
let chunk = self
347347
.request_body

src/body/incoming.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::task::{Context, Poll};
66

77
use bytes::Bytes;
88
#[cfg(all(feature = "http1", any(feature = "client", feature = "server")))]
9-
use futures_channel::{mpsc, oneshot};
9+
use tokio::sync::{mpsc, oneshot};
1010
#[cfg(all(
1111
any(feature = "http1", feature = "http2"),
1212
any(feature = "client", feature = "server")

src/proto/h2/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use std::{
99

1010
use crate::rt::{Read, Write};
1111
use bytes::Bytes;
12-
use futures_channel::mpsc::{Receiver, Sender};
13-
use futures_channel::{mpsc, oneshot};
12+
use tokio::sync::mpsc::{Receiver, Sender};
13+
use tokio::sync::{mpsc, oneshot};
1414
use futures_core::{ready, FusedFuture, FusedStream, Stream};
1515
use h2::client::{Builder, Connection, SendRequest};
1616
use h2::SendStream;

tests/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use hyper::header::{HeaderMap, HeaderName, HeaderValue};
1717
use hyper::{Method, Request, StatusCode, Uri, Version};
1818

1919
use bytes::Bytes;
20-
use futures_channel::oneshot;
20+
use tokio::sync::oneshot;
2121
use futures_util::future::{self, FutureExt, TryFuture, TryFutureExt};
2222
use support::TokioIo;
2323
use tokio::net::TcpStream;
@@ -1494,7 +1494,7 @@ mod conn {
14941494
use std::time::Duration;
14951495

14961496
use bytes::{Buf, Bytes};
1497-
use futures_channel::{mpsc, oneshot};
1497+
use tokio::sync::{mpsc, oneshot};
14981498
use futures_util::future::{self, poll_fn, FutureExt, TryFutureExt};
14991499
use http_body_util::{BodyExt, Empty, Full, StreamBody};
15001500
use hyper::rt::Timer;

tests/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::thread;
1414
use std::time::Duration;
1515

1616
use bytes::Bytes;
17-
use futures_channel::oneshot;
17+
use tokio::sync::oneshot;
1818
use futures_util::future::{self, Either, FutureExt};
1919
use h2::client::SendRequest;
2020
use h2::{RecvStream, SendStream};

0 commit comments

Comments
 (0)