From a2496548d1781799b0f06c9601a62b127372a520 Mon Sep 17 00:00:00 2001 From: Benjamin Richner <28017860+BenjaminRi@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:07:16 +0200 Subject: [PATCH] net: fix examples for `TcpSocket::{set_nodelay,nodelay}` (#6840) --- tokio/src/net/tcp/socket.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio/src/net/tcp/socket.rs b/tokio/src/net/tcp/socket.rs index c528a14fe8e..8ecf9f71253 100644 --- a/tokio/src/net/tcp/socket.rs +++ b/tokio/src/net/tcp/socket.rs @@ -425,7 +425,7 @@ impl TcpSocket { /// # async fn dox() -> Result<(), Box> { /// let socket = TcpSocket::new_v4()?; /// - /// println!("{:?}", socket.nodelay()?); + /// socket.set_nodelay(true)?; /// # Ok(()) /// # } /// ``` @@ -445,9 +445,9 @@ impl TcpSocket { /// use tokio::net::TcpSocket; /// /// # async fn dox() -> Result<(), Box> { - /// let stream = TcpSocket::new_v4()?; + /// let socket = TcpSocket::new_v4()?; /// - /// stream.set_nodelay(true)?; + /// println!("{:?}", socket.nodelay()?); /// # Ok(()) /// # } /// ```