From 17555d71d96ec45d02785e316317489dc8bba13f Mon Sep 17 00:00:00 2001 From: Marek Kuskowski <50183564+nylonicious@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:44:45 +0200 Subject: [PATCH] sync: implement `Default` for `watch::Sender` (#6626) --- tokio/src/sync/watch.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio/src/sync/watch.rs b/tokio/src/sync/watch.rs index 80d479300db..5810c67de60 100644 --- a/tokio/src/sync/watch.rs +++ b/tokio/src/sync/watch.rs @@ -156,6 +156,12 @@ impl Clone for Sender { } } +impl Default for Sender { + fn default() -> Self { + Self::new(T::default()) + } +} + /// Returns a reference to the inner value. /// /// Outstanding borrows hold a read lock on the inner value. This means that