mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
update tcp stream documentation
This commit is contained in:
@@ -44,11 +44,10 @@
|
||||
/// 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")]
|
||||
|
||||
Reference in New Issue
Block a user