Skip to content

Commit

Permalink
Merge pull request #111 from EspressoSystems/dependabot/cargo/async-c…
Browse files Browse the repository at this point in the history
…hannel-2.2.0

build(deps): bump async-channel from 1.9.0 to 2.2.0
  • Loading branch information
jbearer authored Apr 2, 2024
2 parents a4ea7aa + 37a1fe7 commit 5795375
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ tokio = { version = "1", features = [
tokio-stream = { version = "0.1.14" }

[target.'cfg(all(async_channel_impl = "async-std"))'.dependencies]
async-channel = { version = "1.9.0" }
async-std = { version = "1.12", features = [
"attributes",
"unstable",
]}

[target.'cfg(all(async_channel_impl = "flume"))'.dependencies]
flume = { version = "0.11.0" }
8 changes: 4 additions & 4 deletions src/channel/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ mod inner {
/// inner module, used to group feature-specific imports
#[cfg(async_channel_impl = "async-std")]
mod inner {
pub use async_channel::{RecvError, SendError, TryRecvError};
pub use async_std::channel::{RecvError, SendError, TryRecvError};

use async_channel::{Receiver as InnerReceiver, Sender as InnerSender};
use async_std::channel::{Receiver as InnerReceiver, Sender as InnerSender};

/// A bounded sender, created with [`channel`]
pub struct Sender<T>(pub(super) InnerSender<T>);
Expand All @@ -99,7 +99,7 @@ mod inner {
/// Create a bounded sender/receiver pair, limited to `len` messages at a time.
#[must_use]
pub fn bounded<T>(len: usize) -> (Sender<T>, Receiver<T>) {
let (sender, receiver) = async_channel::bounded(len);
let (sender, receiver) = async_std::channel::bounded(len);

(Sender(sender), Receiver(receiver))
}
Expand Down Expand Up @@ -227,7 +227,7 @@ impl<T> Stream for BoundedStream<T> {
cx,
);
#[cfg(async_channel_impl = "async-std")]
return <async_channel::Receiver<T> as Stream>::poll_next(Pin::new(&mut self.0), cx);
return <async_std::channel::Receiver<T> as Stream>::poll_next(Pin::new(&mut self.0), cx);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/channel/unbounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl<T> Stream for UnboundedStream<T> {
cx,
);
#[cfg(async_channel_impl = "async-std")]
return <async_channel::Receiver<T> as Stream>::poll_next(Pin::new(&mut self.0), cx);
return <async_std::channel::Receiver<T> as Stream>::poll_next(Pin::new(&mut self.0), cx);
}
}

Expand Down

0 comments on commit 5795375

Please sign in to comment.