From 18b09638eb5868e908be49adcd4c2ccb3495012a Mon Sep 17 00:00:00 2001 From: Bryan Woods Date: Sat, 18 Nov 2023 13:00:06 -0800 Subject: [PATCH] Add `Clone` conformance to `WeakSender` --- CHANGELOG.md | 2 ++ src/lib.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14a604f..37692e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- `WeakSender` is now `Clone` + ### Fixed # [0.11.0] - 2023-08-16 diff --git a/src/lib.rs b/src/lib.rs index c9bb3ee..3b79610 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -858,6 +858,13 @@ impl WeakSender { } } +impl Clone for WeakSender { + /// Clones this [`WeakSender`]. + fn clone(&self) -> Self { + Self { shared: self.shared.clone() } + } +} + /// The receiving end of a channel. /// /// Note: Cloning the receiver *does not* turn this channel into a broadcast channel.