Skip to content

Commit 5e3146a

Browse files
committed
Update for async_std 1.9.0 (with pin-project-lite 0.2.0)
Previously, the sync module in async_std was unstable in 1.5.0. After stabilization the API was changed, so parallel-stream would fail to build for projects which depend on newer versions of async_std.
1 parent b2e016e commit 5e3146a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authors = [
1616
[features]
1717

1818
[dependencies]
19-
async-std = { version = "1.5.0", features = ["attributes", "unstable"] }
20-
pin-project-lite = "0.1.4"
19+
async-std = { version = "1.9.0", features = ["attributes", "unstable"] }
20+
pin-project-lite = "0.2.0"
2121

2222
[dev-dependencies]

src/par_stream/for_each.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use async_std::channel::{self, Receiver, Sender};
12
use async_std::prelude::*;
2-
use async_std::sync::{self, Receiver, Sender};
33
use async_std::task::{self, Context, Poll};
44

55
use std::pin::Pin;
@@ -32,7 +32,7 @@ impl ForEach {
3232
{
3333
let exhausted = Arc::new(AtomicBool::new(false));
3434
let ref_count = Arc::new(AtomicU64::new(0));
35-
let (sender, receiver): (Sender<()>, Receiver<()>) = sync::channel(1);
35+
let (sender, receiver): (Sender<()>, Receiver<()>) = channel::bounded(1);
3636
let _limit = stream.get_limit();
3737

3838
// Initialize the return type here to prevent borrowing issues.

src/par_stream/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// use async_std::prelude::*;
2+
use async_std::channel::{self, Receiver};
23
use async_std::future::Future;
3-
use async_std::sync::{self, Receiver};
44
use async_std::task;
55

66
use std::pin::Pin;
@@ -26,7 +26,7 @@ impl<T: Send + 'static> Map<T> {
2626
F: FnMut(S::Item) -> Fut + Send + Sync + Copy + 'static,
2727
Fut: Future<Output = T> + Send,
2828
{
29-
let (sender, receiver) = sync::channel(1);
29+
let (sender, receiver) = channel::bounded(1);
3030
let limit = stream.get_limit();
3131
task::spawn(async move {
3232
while let Some(item) = stream.next().await {

0 commit comments

Comments
 (0)