Skip to content

Commit

Permalink
Rollup merge of rust-lang#36134 - tshepang:more-simple, r=steveklabnik
Browse files Browse the repository at this point in the history
doc: make TcpListener example more simple
  • Loading branch information
Jonathan Turner authored Aug 31, 2016
2 parents 668a34d + c36ccf7 commit 422305a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub struct TcpStream(net_imp::TcpStream);
///
/// ```no_run
/// use std::net::{TcpListener, TcpStream};
/// use std::thread;
///
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
///
Expand All @@ -57,17 +56,11 @@ pub struct TcpStream(net_imp::TcpStream);
/// for stream in listener.incoming() {
/// match stream {
/// Ok(stream) => {
/// thread::spawn(move|| {
/// // connection succeeded
/// handle_client(stream)
/// });
/// handle_client(stream);
/// }
/// Err(e) => { /* connection failed */ }
/// }
/// }
///
/// // close the socket server
/// drop(listener);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub struct TcpListener(net_imp::TcpListener);
Expand Down

0 comments on commit 422305a

Please sign in to comment.