From 1a4cf319b56a8fee2a9f66d5fcdca9b6d69bd54d Mon Sep 17 00:00:00 2001 From: Mattia <62722102+mattiapitossi@users.noreply.github.com> Date: Sun, 5 Oct 2025 09:14:38 +0200 Subject: [PATCH] sync: improve the docs of `UnboundedSender::send` (#7661) --- tokio/src/sync/mpsc/unbounded.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tokio/src/sync/mpsc/unbounded.rs b/tokio/src/sync/mpsc/unbounded.rs index add38672..5e842ea8 100644 --- a/tokio/src/sync/mpsc/unbounded.rs +++ b/tokio/src/sync/mpsc/unbounded.rs @@ -533,9 +533,10 @@ impl UnboundedSender { /// 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 -- 2.43.0