Skip to content

Commit a249654

Browse files
authored
net: fix examples for TcpSocket::{set_nodelay,nodelay} (tokio-rs#6840)
1 parent 0cea36f commit a249654

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tokio/src/net/tcp/socket.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl TcpSocket {
425425
/// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
426426
/// let socket = TcpSocket::new_v4()?;
427427
///
428-
/// println!("{:?}", socket.nodelay()?);
428+
/// socket.set_nodelay(true)?;
429429
/// # Ok(())
430430
/// # }
431431
/// ```
@@ -445,9 +445,9 @@ impl TcpSocket {
445445
/// use tokio::net::TcpSocket;
446446
///
447447
/// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
448-
/// let stream = TcpSocket::new_v4()?;
448+
/// let socket = TcpSocket::new_v4()?;
449449
///
450-
/// stream.set_nodelay(true)?;
450+
/// println!("{:?}", socket.nodelay()?);
451451
/// # Ok(())
452452
/// # }
453453
/// ```

0 commit comments

Comments
 (0)