]> git.feebdaed.xyz Git - 0xmirror/tokio.git/commitdiff
sync: improve the docs of `UnboundedSender::send` (#7661)
authorMattia <62722102+mattiapitossi@users.noreply.github.com>
Sun, 5 Oct 2025 07:14:38 +0000 (09:14 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Oct 2025 07:14:38 +0000 (15:14 +0800)
tokio/src/sync/mpsc/unbounded.rs

index add38672e771e065973a2dadd678f87fd2b26840..5e842ea8f7e418d1565dccb563474c243f02734d 100644 (file)
@@ -533,9 +533,10 @@ impl<T> UnboundedSender<T> {
 
     /// Attempts to send a message on this `UnboundedSender` without blocking.
     ///
-    /// This method is not marked async because sending a message to an unbounded channel
-    /// never requires any form of waiting. Because of this, the `send` method can be
-    /// used in both synchronous and asynchronous code without problems.
+    /// This method is not marked as `async` because sending a message to an unbounded channel
+    /// never requires any form of waiting. This is due to the channel's infinite capacity,
+    /// allowing the `send` operation to complete immediately. As a result, the `send` method can be
+    /// used in both synchronous and asynchronous code without issues.
     ///
     /// If the receive half of the channel is closed, either due to [`close`]
     /// being called or the [`UnboundedReceiver`] having been dropped, this