Skip to content

Commit 76d08ed

Browse files
committed
Update std::net:Incoming's docs to use standard iterator boilerplate
Part of #29363
1 parent 169facf commit 76d08ed

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libstd/net/tcp.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,14 @@ pub struct TcpStream(net_imp::TcpStream);
6565
#[stable(feature = "rust1", since = "1.0.0")]
6666
pub struct TcpListener(net_imp::TcpListener);
6767

68-
/// An infinite iterator over the connections from a `TcpListener`.
69-
///
70-
/// This iterator will infinitely yield [`Some`] of the accepted connections. It
71-
/// is equivalent to calling `accept` in a loop.
68+
/// An iterator that infinitely [`accept`]s connections on a [`TcpListener`].
7269
///
7370
/// This `struct` is created by the [`incoming`] method on [`TcpListener`].
71+
/// See its documentation for more.
7472
///
75-
/// [`Some`]: ../../std/option/enum.Option.html#variant.Some
76-
/// [`incoming`]: struct.TcpListener.html#method.incoming
77-
/// [`TcpListener`]: struct.TcpListener.html
73+
/// [`accept`]: ../../std/net/struct.TcpListener.html#method.accept
74+
/// [`incoming`]: ../../std/net/struct.TcpListener.html#method.incoming
75+
/// [`TcpListener`]: ../../std/net/struct.TcpListener.html
7876
#[stable(feature = "rust1", since = "1.0.0")]
7977
#[derive(Debug)]
8078
pub struct Incoming<'a> { listener: &'a TcpListener }
@@ -583,10 +581,12 @@ impl TcpListener {
583581
/// listener.
584582
///
585583
/// The returned iterator will never return [`None`] and will also not yield
586-
/// the peer's [`SocketAddr`] structure.
584+
/// the peer's [`SocketAddr`] structure. Iterating over it is equivalent to
585+
/// calling [`accept`] in a loop.
587586
///
588587
/// [`None`]: ../../std/option/enum.Option.html#variant.None
589588
/// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
589+
/// [`accept`]: #method.accept
590590
///
591591
/// # Examples
592592
///

0 commit comments

Comments
 (0)