Skip to content

Commit 4590828

Browse files
authored
stream: improve the the docs of TcpListenerStream (#7578)
Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
1 parent a99a351 commit 4590828

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tokio-stream/src/wrappers/tcp_listener.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ use tokio::net::{TcpListener, TcpStream};
1818
///
1919
/// # #[tokio::main(flavor = "current_thread")]
2020
/// # async fn main() -> std::io::Result<()> {
21-
/// let ipv4_listener = TcpListener::bind((Ipv6Addr::LOCALHOST, 8080)).await?;
22-
/// let ipv6_listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 8080)).await?;
21+
/// let ipv4_listener = TcpListener::bind((Ipv4Addr::LOCALHOST, 8080)).await?;
22+
/// let ipv6_listener = TcpListener::bind((Ipv6Addr::LOCALHOST, 8080)).await?;
2323
/// let ipv4_connections = TcpListenerStream::new(ipv4_listener);
2424
/// let ipv6_connections = TcpListenerStream::new(ipv6_listener);
2525
///
26-
/// let mut connections = ipv4_connections.chain(ipv6_connections);
26+
/// let mut connections = ipv4_connections.merge(ipv6_connections);
2727
/// while let Some(tcp_stream) = connections.next().await {
2828
/// let stream = tcp_stream?;
2929
/// let peer_addr = stream.peer_addr()?;

0 commit comments

Comments
 (0)