diff --git a/src/lib.rs b/src/lib.rs index 59fe9fb..d6d8442 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -828,7 +828,6 @@ impl futures_core::stream::FusedStream for Receiver { /// /// This is created through the [`Sender::downgrade`] method. In order to use it, it needs /// to be upgraded into a [`Sender`] through the `upgrade` method. -#[derive(Clone)] pub struct WeakSender { channel: Arc>, } @@ -857,6 +856,14 @@ impl WeakSender { } } +impl Clone for WeakSender { + fn clone(&self) -> Self { + WeakSender { + channel: self.channel.clone(), + } + } +} + impl fmt::Debug for WeakSender { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "WeakSender {{ .. }}") @@ -867,7 +874,6 @@ impl fmt::Debug for WeakSender { /// /// This is created through the [`Receiver::downgrade`] method. In order to use it, it needs /// to be upgraded into a [`Receiver`] through the `upgrade` method. -#[derive(Clone)] pub struct WeakReceiver { channel: Arc>, } @@ -897,6 +903,14 @@ impl WeakReceiver { } } +impl Clone for WeakReceiver { + fn clone(&self) -> Self { + WeakReceiver { + channel: self.channel.clone(), + } + } +} + impl fmt::Debug for WeakReceiver { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "WeakReceiver {{ .. }}")