Skip to content

Commit 3ee91a3

Browse files
authored
Merge pull request #21 from alexmaco/updates
Fix build with async_std 1.9.0
2 parents b2e016e + 411ef7a commit 3ee91a3

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
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/from_parallel_stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async fn is_send() {
1818
let v: Vec<usize> = vec![1, 2, 3, 4];
1919
let stream = v.into_par_stream().map(|n| async move { n * n });
2020
let mut res = Vec::from_par_stream(stream).await;
21-
res.sort();
21+
res.sort_unstable();
2222
assert_eq!(res, vec![1, 4, 9, 16]);
2323
})
2424
.await;

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 {

src/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async fn smoke() {
9494
while let Some(n) = stream.next().await {
9595
out.push(n);
9696
}
97-
out.sort();
97+
out.sort_unstable();
9898

9999
assert_eq!(out, vec![1usize, 4, 9, 16]);
100100
}

0 commit comments

Comments
 (0)