Skip to content

Commit

Permalink
fix tokio
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-maron committed Jul 10, 2024
1 parent 6cb6342 commit a4337cc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/channel/bounded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use futures::Stream;
/// inner module, used to group feature-specific imports
#[cfg(async_channel_impl = "tokio")]
mod inner {
pub use tokio::sync::mpsc::error::{SendError, TryRecvError};
pub use tokio::sync::mpsc::error::{SendError, TryRecvError, TrySendError};

use tokio::sync::mpsc::{Receiver as InnerReceiver, Sender as InnerSender};

Expand Down Expand Up @@ -128,12 +128,7 @@ impl<T> Sender<T> {
/// - If the channel is full
/// - If the channel is dropped
pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
#[cfg(async_channel_impl = "flume")]
let result = self.0.try_send(msg);
#[cfg(not(all(async_channel_impl = "flume")))]
let result = self.0.try_send(msg);

result
self.0.try_send(msg)
}
}

Expand Down

0 comments on commit a4337cc

Please sign in to comment.