Skip to content

Commit

Permalink
Rollup merge of rust-lang#41526 - steveklabnik:gh35950, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Clean up TcpStream example

Fixes rust-lang#35950
  • Loading branch information
Ariel Ben-Yehuda authored Apr 25, 2017
2 parents de7b4aa + ca96892 commit a1a19e6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub struct TcpStream(net_imp::TcpStream);
/// # Examples
///
/// ```no_run
/// # use std::io;
/// use std::net::{TcpListener, TcpStream};
///
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
Expand All @@ -81,15 +82,13 @@ pub struct TcpStream(net_imp::TcpStream);
/// // ...
/// }
///
/// # fn process() -> io::Result<()> {
/// // accept connections and process them serially
/// for stream in listener.incoming() {
/// match stream {
/// Ok(stream) => {
/// handle_client(stream);
/// }
/// Err(e) => { /* connection failed */ }
/// }
/// handle_client(stream?);
/// }
/// # Ok(())
/// # }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub struct TcpListener(net_imp::TcpListener);
Expand Down

0 comments on commit a1a19e6

Please sign in to comment.