From f61374f931a55357dcc20a9d9b55cc0c509f90f3 Mon Sep 17 00:00:00 2001 From: Muzzaiyyan Hussain Date: Tue, 3 Feb 2026 20:52:34 +0530 Subject: [PATCH] io: fix incorrect and confusing AsyncWrite documentation (#7875) --- tokio/src/io/async_write.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tokio/src/io/async_write.rs b/tokio/src/io/async_write.rs index 3c315a1bf..68cee03c4 100644 --- a/tokio/src/io/async_write.rs +++ b/tokio/src/io/async_write.rs @@ -27,11 +27,10 @@ use std::task::{Context, Poll}; /// * `Poll::Ready(Err(e))` for other errors are standard I/O errors coming from the /// underlying object. /// -/// This trait importantly means that the `write` method only works in the -/// context of a future's task. The object may panic if used outside of a task. -/// /// Utilities for working with `AsyncWrite` values are provided by -/// [`AsyncWriteExt`]. +/// [`AsyncWriteExt`]. Most users will interact with `AsyncWrite` types through +/// these extension methods, which provide ergonomic async functions such as +/// `write_all` and `flush`. /// /// [`std::io::Write`]: std::io::Write /// [`Write::write`]: std::io::Write::write()