about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorCharles Hathaway <charles@yottadb.com>2018-10-10 11:13:35 -0400
committerCharles Hathaway <charles@yottadb.com>2018-10-10 11:16:01 -0400
commitc514b627e4bea768fe8560b96ce585689d008017 (patch)
tree69429361d8d5860d896e02cf0183250b9fad5f48 /src/libstd
parent2243fabd8f25c46a4a76199f10a2cd9adbb5c418 (diff)
downloadrust-c514b627e4bea768fe8560b96ce585689d008017.tar.gz
rust-c514b627e4bea768fe8560b96ce585689d008017.zip
update tcp stream documentation
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/net/tcp.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 75c7a3d9280..848570e75e7 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -44,11 +44,10 @@ use time::Duration;
 /// use std::net::TcpStream;
 ///
 /// {
-///     let mut stream = TcpStream::connect("127.0.0.1:34254").unwrap();
+///     let mut stream = TcpStream::connect("127.0.0.1:34254")?;
 ///
-///     // ignore the Result
-///     let _ = stream.write(&[1]);
-///     let _ = stream.read(&mut [0; 128]); // ignore here too
+///     stream.write(&[1])?;
+///     stream.read(&mut [0; 128])?;
 /// } // the stream is closed here
 /// ```
 #[stable(feature = "rust1", since = "1.0.0")]