未验证 提交 699f591a 编写于 作者: P Pietro Albini 提交者: GitHub

Rollup merge of #54965 - chathaway-codes:update-tcp-stream-docs, r=GuillaumeGomez

update tcp stream documentation

A small styling issue that seemed inconsistent here when compared to other places (such as https://doc.rust-lang.org/beta/std/net/struct.TcpListener.html).
......@@ -43,12 +43,12 @@
/// use std::io::prelude::*;
/// use std::net::TcpStream;
///
/// {
/// let mut stream = TcpStream::connect("127.0.0.1:34254").unwrap();
/// fn main() -> std::io::Result<()> {
/// 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])?;
/// Ok(())
/// } // the stream is closed here
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册