about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorlukaramu <lukaramu@gmail.com>2017-03-26 14:30:03 +0200
committerlukaramu <lukaramu@gmail.com>2017-03-26 14:35:12 +0200
commit76d08eda7d228ed475bf190253b8fd7ebfe667db (patch)
tree2b086bef7e746b39322196ddd21b8d23646832f4 /src
parent169facfc288586b7635652abace56d56da2a6f99 (diff)
downloadrust-76d08eda7d228ed475bf190253b8fd7ebfe667db.tar.gz
rust-76d08eda7d228ed475bf190253b8fd7ebfe667db.zip
Update std::net:Incoming's docs to use standard iterator boilerplate
Part of #29363
Diffstat (limited to 'src')
-rw-r--r--src/libstd/net/tcp.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 8a21f17dc49..c6cf748d981 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -65,16 +65,14 @@ pub struct TcpStream(net_imp::TcpStream);
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct TcpListener(net_imp::TcpListener);
 
-/// An infinite iterator over the connections from a `TcpListener`.
-///
-/// This iterator will infinitely yield [`Some`] of the accepted connections. It
-/// is equivalent to calling `accept` in a loop.
+/// An iterator that infinitely [`accept`]s connections on a [`TcpListener`].
 ///
 /// This `struct` is created by the [`incoming`] method on [`TcpListener`].
+/// See its documentation for more.
 ///
-/// [`Some`]: ../../std/option/enum.Option.html#variant.Some
-/// [`incoming`]: struct.TcpListener.html#method.incoming
-/// [`TcpListener`]: struct.TcpListener.html
+/// [`accept`]: ../../std/net/struct.TcpListener.html#method.accept
+/// [`incoming`]: ../../std/net/struct.TcpListener.html#method.incoming
+/// [`TcpListener`]: ../../std/net/struct.TcpListener.html
 #[stable(feature = "rust1", since = "1.0.0")]
 #[derive(Debug)]
 pub struct Incoming<'a> { listener: &'a TcpListener }
@@ -583,10 +581,12 @@ impl TcpListener {
     /// listener.
     ///
     /// The returned iterator will never return [`None`] and will also not yield
-    /// the peer's [`SocketAddr`] structure.
+    /// the peer's [`SocketAddr`] structure. Iterating over it is equivalent to
+    /// calling [`accept`] in a loop.
     ///
     /// [`None`]: ../../std/option/enum.Option.html#variant.None
     /// [`SocketAddr`]: ../../std/net/enum.SocketAddr.html
+    /// [`accept`]: #method.accept
     ///
     /// # Examples
     ///