Skip to content

Commit 0d7ee6a

Browse files
committed
async_trait is no longer needed
1 parent ea8b0b5 commit 0d7ee6a

File tree

3 files changed

+0
-9
lines changed

3 files changed

+0
-9
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ rust-version = "1.61"
2020
crossbeam = "0.8"
2121
futures = "0.3"
2222
enum_dispatch = "0.3"
23-
async-trait = "0"
2423
parking_lot = "0"
2524
tokio = { version = "1", features = ["time"], optional=true }
2625
async-std = {version = "1", optional=true}

src/async_rx.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::channel::*;
22
use crate::stream::AsyncStream;
3-
use async_trait::async_trait;
43
use crossbeam::channel::Receiver;
54
#[cfg(feature = "tokio")]
65
pub use crossbeam::channel::RecvTimeoutError;
@@ -341,7 +340,6 @@ impl<T> Future for ReceiveTimeoutFuture<'_, T> {
341340
}
342341

343342
/// For writing generic code with MAsyncRx & AsyncRx
344-
#[async_trait]
345343
pub trait AsyncRxTrait<T: Unpin + Send + 'static>: Send + 'static {
346344
/// Receive message, will await when channel is empty.
347345
///
@@ -385,7 +383,6 @@ pub trait AsyncRxTrait<T: Unpin + Send + 'static>: Send + 'static {
385383
fn get_waker_size(&self) -> (usize, usize);
386384
}
387385

388-
#[async_trait]
389386
impl<T: Unpin + Send + 'static> AsyncRxTrait<T> for AsyncRx<T> {
390387
#[inline(always)]
391388
fn recv<'a>(&'a self) -> ReceiveFuture<'a, T> {
@@ -476,7 +473,6 @@ impl<T> DerefMut for MAsyncRx<T> {
476473
}
477474
}
478475

479-
#[async_trait]
480476
impl<T: Unpin + Send + 'static> AsyncRxTrait<T> for MAsyncRx<T> {
481477
#[inline(always)]
482478
fn try_recv(&self) -> Result<T, TryRecvError> {

src/async_tx.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::channel::*;
2-
use async_trait::async_trait;
32
#[cfg(feature = "tokio")]
43
pub use crossbeam::channel::SendTimeoutError;
54
use crossbeam::channel::Sender;
@@ -338,7 +337,6 @@ impl<T: Unpin + Send + 'static> Future for SendTimeoutFuture<'_, T> {
338337
}
339338

340339
/// For writing generic code with MAsyncTx & AsyncTx
341-
#[async_trait]
342340
pub trait AsyncTxTrait<T: Unpin + Send + 'static>: Send + 'static {
343341
/// Just for debugging purpose, to monitor queue size
344342
#[cfg(test)]
@@ -383,7 +381,6 @@ pub trait AsyncTxTrait<T: Unpin + Send + 'static>: Send + 'static {
383381
) -> SendTimeoutFuture<'a, T>;
384382
}
385383

386-
#[async_trait]
387384
impl<T: Unpin + Send + 'static> AsyncTxTrait<T> for AsyncTx<T> {
388385
#[inline(always)]
389386
#[cfg(test)]
@@ -462,7 +459,6 @@ impl<T> DerefMut for MAsyncTx<T> {
462459
}
463460
}
464461

465-
#[async_trait]
466462
impl<T: Unpin + Send + 'static> AsyncTxTrait<T> for MAsyncTx<T> {
467463
#[inline(always)]
468464
fn try_send(&self, item: T) -> Result<(), TrySendError<T>> {

0 commit comments

Comments
 (0)