summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync/mpsc/unbounded.rs
diff options
context:
space:
mode:
authorZahari Dichev <zaharidichev@gmail.com>2020-10-12 19:09:36 +0300
committerGitHub <noreply@github.com>2020-10-12 12:09:36 -0400
commitb5750825431afe6fe227a6fcf30a593b51ceff1b (patch)
tree37ea4bb6ce9d2d478cac48d0e0ea9a0992f575eb /tokio/src/sync/mpsc/unbounded.rs
parentc4f620cb30fb5c98655ecd4726f913e488f90b5b (diff)
sync: change chan `closed(&mut self)` to `closed(&self)` (#2939)
Diffstat (limited to 'tokio/src/sync/mpsc/unbounded.rs')
-rw-r--r--tokio/src/sync/mpsc/unbounded.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/tokio/src/sync/mpsc/unbounded.rs b/tokio/src/sync/mpsc/unbounded.rs
index b92cbc05..fe882d5b 100644
--- a/tokio/src/sync/mpsc/unbounded.rs
+++ b/tokio/src/sync/mpsc/unbounded.rs
@@ -223,11 +223,11 @@ impl<T> UnboundedSender<T> {
///
/// #[tokio::main]
/// async fn main() {
- /// let (mut tx1, rx) = mpsc::unbounded_channel::<()>();
- /// let mut tx2 = tx1.clone();
- /// let mut tx3 = tx1.clone();
- /// let mut tx4 = tx1.clone();
- /// let mut tx5 = tx1.clone();
+ /// let (tx1, rx) = mpsc::unbounded_channel::<()>();
+ /// let tx2 = tx1.clone();
+ /// let tx3 = tx1.clone();
+ /// let tx4 = tx1.clone();
+ /// let tx5 = tx1.clone();
/// tokio::spawn(async move {
/// drop(rx);
/// });
@@ -242,7 +242,7 @@ impl<T> UnboundedSender<T> {
//// println!("Receiver dropped");
/// }
/// ```
- pub async fn closed(&mut self) {
+ pub async fn closed(&self) {
self.chan.closed().await
}
/// Checks if the channel has been closed. This happens when the