Skip to content

Commit

Permalink
sync: implement Default for watch::Sender (#6626)
Browse files Browse the repository at this point in the history
  • Loading branch information
nylonicious committed Jun 10, 2024
1 parent 341b5da commit 17555d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tokio/src/sync/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ impl<T> Clone for Sender<T> {
}
}

impl<T: Default> Default for Sender<T> {
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
Expand Down

0 comments on commit 17555d7

Please sign in to comment.