Skip to content

Commit a4337cc

Browse files
committed
fix tokio
1 parent 6cb6342 commit a4337cc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/channel/bounded.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use futures::Stream;
55
/// inner module, used to group feature-specific imports
66
#[cfg(async_channel_impl = "tokio")]
77
mod inner {
8-
pub use tokio::sync::mpsc::error::{SendError, TryRecvError};
8+
pub use tokio::sync::mpsc::error::{SendError, TryRecvError, TrySendError};
99

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

@@ -128,12 +128,7 @@ impl<T> Sender<T> {
128128
/// - If the channel is full
129129
/// - If the channel is dropped
130130
pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
131-
#[cfg(async_channel_impl = "flume")]
132-
let result = self.0.try_send(msg);
133-
#[cfg(not(all(async_channel_impl = "flume")))]
134-
let result = self.0.try_send(msg);
135-
136-
result
131+
self.0.try_send(msg)
137132
}
138133
}
139134

0 commit comments

Comments
 (0)