File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ pub struct TcpStream(net_imp::TcpStream);
73
73
/// # Examples
74
74
///
75
75
/// ```no_run
76
+ /// # use std::io;
76
77
/// use std::net::{TcpListener, TcpStream};
77
78
///
78
79
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
@@ -81,15 +82,13 @@ pub struct TcpStream(net_imp::TcpStream);
81
82
/// // ...
82
83
/// }
83
84
///
85
+ /// # fn process() -> io::Result<()> {
84
86
/// // accept connections and process them serially
85
87
/// for stream in listener.incoming() {
86
- /// match stream {
87
- /// Ok(stream) => {
88
- /// handle_client(stream);
89
- /// }
90
- /// Err(e) => { /* connection failed */ }
91
- /// }
88
+ /// handle_client(stream?);
92
89
/// }
90
+ /// # Ok(())
91
+ /// # }
93
92
/// ```
94
93
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
95
94
pub struct TcpListener ( net_imp:: TcpListener ) ;
You can’t perform that action at this time.
0 commit comments