Skip to content

Commit

Permalink
doc: make TcpListener example more simple
Browse files Browse the repository at this point in the history
  • Loading branch information
tshepang committed Aug 30, 2016
1 parent 86dde9b commit c36ccf7
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 c36ccf7

Please sign in to comment.