Skip to content

Commit 69bed38

Browse files
committed
no longer use async_std::sync::channel
1 parent 7179b60 commit 69bed38

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ edition = "2018"
1919

2020
[dependencies]
2121
httparse = "1.3.4"
22-
async-std = { version = "1.7.0", features = ["unstable"] }
22+
async-std = "1.7.0"
2323
http-types = "2.9.0"
2424
byte-pool = "0.2.2"
2525
lazy_static = "1.4.0"
2626
futures-core = "0.3.8"
2727
log = "0.4.11"
2828
pin-project = "1.0.2"
29+
async-channel = "1.5.1"
2930

3031
[dev-dependencies]
3132
pretty_assertions = "0.6.1"
32-
async-std = { version = "1.7.0", features = ["unstable", "attributes"] }
33+
async-std = { version = "1.7.0", features = ["attributes"] }
3334
tempfile = "3.1.0"
3435
async-test = "1.0.0"
3536
duplexify = "1.2.2"

src/read_notifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use std::fmt;
22
use std::pin::Pin;
33
use std::task::{Context, Poll};
44

5+
use async_channel::Sender;
56
use async_std::io::{self, BufRead, Read};
6-
use async_std::sync::Sender;
77

88
/// ReadNotifier forwards [`async_std::io::Read`] and
99
/// [`async_std::io::BufRead`] to an inner reader. When the

src/server/decode.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::str::FromStr;
44

55
use async_std::io::{BufReader, Read, Write};
6-
use async_std::{prelude::*, sync, task};
6+
use async_std::{prelude::*, task};
77
use http_types::headers::{CONTENT_LENGTH, EXPECT, TRANSFER_ENCODING};
88
use http_types::{ensure, ensure_eq, format_err};
99
use http_types::{Body, Method, Request, Url};
@@ -92,7 +92,7 @@ where
9292
// allows us to avoid sending 100-continue in situations that
9393
// respond without reading the body, saving clients from uploading
9494
// their body.
95-
let (body_read_sender, body_read_receiver) = sync::channel(1);
95+
let (body_read_sender, body_read_receiver) = async_channel::bounded(1);
9696

9797
if Some(CONTINUE_HEADER_VALUE) == req.header(EXPECT).map(|h| h.as_str()) {
9898
task::spawn(async move {

0 commit comments

Comments
 (0)