@@ -146,6 +146,7 @@ impl SocketAddr {
146146 /// let socket = UnixListener::bind("/tmp/sock")?;
147147 /// let addr = socket.local_addr().expect("Couldn't get local address");
148148 /// assert_eq!(addr.is_unnamed(), false);
149+ /// Ok(())
149150 /// }
150151 /// ```
151152 ///
@@ -158,6 +159,7 @@ impl SocketAddr {
158159 /// let socket = UnixDatagram::unbound()?;
159160 /// let addr = socket.local_addr().expect("Couldn't get local address");
160161 /// assert_eq!(addr.is_unnamed(), true);
162+ /// Ok(())
161163 /// }
162164 /// ```
163165 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -183,6 +185,7 @@ impl SocketAddr {
183185 /// let socket = UnixListener::bind("/tmp/sock")?;
184186 /// let addr = socket.local_addr().expect("Couldn't get local address");
185187 /// assert_eq!(addr.as_pathname(), Some(Path::new("/tmp/sock")));
188+ /// Ok(())
186189 /// }
187190 /// ```
188191 ///
@@ -195,6 +198,7 @@ impl SocketAddr {
195198 /// let socket = UnixDatagram::unbound()?;
196199 /// let addr = socket.local_addr().expect("Couldn't get local address");
197200 /// assert_eq!(addr.as_pathname(), None);
201+ /// Ok(())
198202 /// }
199203 /// ```
200204 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -261,6 +265,7 @@ impl<'a> fmt::Display for AsciiEscaped<'a> {
261265/// let mut response = String::new();
262266/// stream.read_to_string(&mut response)?;
263267/// println!("{}", response);
268+ /// Ok(())
264269/// }
265270/// ```
266271#[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -349,6 +354,7 @@ impl UnixStream {
349354 /// fn main() -> std::io::Result<()> {
350355 /// let socket = UnixStream::connect("/tmp/sock")?;
351356 /// let sock_copy = socket.try_clone().expect("Couldn't clone socket");
357+ /// Ok(())
352358 /// }
353359 /// ```
354360 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -366,6 +372,7 @@ impl UnixStream {
366372 /// fn main() -> std::io::Result<()> {
367373 /// let socket = UnixStream::connect("/tmp/sock")?;
368374 /// let addr = socket.local_addr().expect("Couldn't get local address");
375+ /// Ok(())
369376 /// }
370377 /// ```
371378 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -383,6 +390,7 @@ impl UnixStream {
383390 /// fn main() -> std::io::Result<()> {
384391 /// let socket = UnixStream::connect("/tmp/sock")?;
385392 /// let addr = socket.peer_addr().expect("Couldn't get peer address");
393+ /// Ok(())
386394 /// }
387395 /// ```
388396 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -424,6 +432,7 @@ impl UnixStream {
424432 /// let result = socket.set_read_timeout(Some(Duration::new(0, 0)));
425433 /// let err = result.unwrap_err();
426434 /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
435+ /// Ok(())
427436 /// }
428437 /// ```
429438 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -452,6 +461,7 @@ impl UnixStream {
452461 /// let socket = UnixStream::connect("/tmp/sock")?;
453462 /// socket.set_write_timeout(Some(Duration::new(1, 0)))
454463 /// .expect("Couldn't set write timeout");
464+ /// Ok(())
455465 /// }
456466 /// ```
457467 ///
@@ -468,6 +478,7 @@ impl UnixStream {
468478 /// let result = socket.set_write_timeout(Some(Duration::new(0, 0)));
469479 /// let err = result.unwrap_err();
470480 /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
481+ /// Ok(())
471482 /// }
472483 /// ```
473484 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -487,6 +498,7 @@ impl UnixStream {
487498 /// let socket = UnixStream::connect("/tmp/sock")?;
488499 /// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
489500 /// assert_eq!(socket.read_timeout()?, Some(Duration::new(1, 0)));
501+ /// Ok(())
490502 /// }
491503 /// ```
492504 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -507,6 +519,7 @@ impl UnixStream {
507519 /// socket.set_write_timeout(Some(Duration::new(1, 0)))
508520 /// .expect("Couldn't set write timeout");
509521 /// assert_eq!(socket.write_timeout()?, Some(Duration::new(1, 0)));
522+ /// Ok(())
510523 /// }
511524 /// ```
512525 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -524,6 +537,7 @@ impl UnixStream {
524537 /// fn main() -> std::io::Result<()> {
525538 /// let socket = UnixStream::connect("/tmp/sock")?;
526539 /// socket.set_nonblocking(true).expect("Couldn't set nonblocking");
540+ /// Ok(())
527541 /// }
528542 /// ```
529543 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -543,6 +557,7 @@ impl UnixStream {
543557 /// if let Ok(Some(err)) = socket.take_error() {
544558 /// println!("Got error: {:?}", err);
545559 /// }
560+ /// Ok(())
546561 /// }
547562 /// ```
548563 ///
@@ -570,6 +585,7 @@ impl UnixStream {
570585 /// fn main() -> std::io::Result<()> {
571586 /// let socket = UnixStream::connect("/tmp/sock");
572587 /// socket.shutdown(Shutdown::Both).expect("shutdown function failed");
588+ /// Ok(())
573589 /// }
574590 /// ```
575591 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -747,6 +763,7 @@ impl IntoRawFd for net::UdpSocket {
747763/// }
748764/// }
749765/// }
766+ /// Ok(())
750767/// }
751768/// ```
752769#[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -816,6 +833,7 @@ impl UnixListener {
816833 /// Ok((socket, addr)) => println!("Got a client: {:?}", addr),
817834 /// Err(e) => println!("accept function failed: {:?}", e),
818835 /// }
836+ /// Ok(())
819837 /// }
820838 /// ```
821839 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -840,8 +858,8 @@ impl UnixListener {
840858 ///
841859 /// fn main() -> std::io::Result<()> {
842860 /// let listener = UnixListener::bind("/path/to/the/socket")?;
843- ///
844861 /// let listener_copy = listener.try_clone().expect("try_clone failed");
862+ /// Ok(())
845863 /// }
846864 /// ```
847865 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -858,8 +876,8 @@ impl UnixListener {
858876 ///
859877 /// fn main() -> std::io::Result<()> {
860878 /// let listener = UnixListener::bind("/path/to/the/socket")?;
861- ///
862879 /// let addr = listener.local_addr().expect("Couldn't get local address");
880+ /// Ok(())
863881 /// }
864882 /// ```
865883 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -876,8 +894,8 @@ impl UnixListener {
876894 ///
877895 /// fn main() -> std::io::Result<()> {
878896 /// let listener = UnixListener::bind("/path/to/the/socket")?;
879- ///
880897 /// listener.set_nonblocking(true).expect("Couldn't set non blocking");
898+ /// Ok(())
881899 /// }
882900 /// ```
883901 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -898,6 +916,7 @@ impl UnixListener {
898916 /// if let Ok(Some(err)) = listener.take_error() {
899917 /// println!("Got error: {:?}", err);
900918 /// }
919+ /// Ok(())
901920 /// }
902921 /// ```
903922 ///
@@ -939,6 +958,7 @@ impl UnixListener {
939958 /// }
940959 /// }
941960 /// }
961+ /// Ok(())
942962 /// }
943963 /// ```
944964 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1008,6 +1028,7 @@ impl<'a> IntoIterator for &'a UnixListener {
10081028/// }
10091029/// }
10101030/// }
1031+ /// Ok(())
10111032/// }
10121033/// ```
10131034#[ derive( Debug ) ]
@@ -1042,6 +1063,7 @@ impl<'a> Iterator for Incoming<'a> {
10421063/// let mut buf = [0; 100];
10431064/// let (count, address) = socket.recv_from(&mut buf)?;
10441065/// println!("socket {:?} sent {:?}", address, &buf[..count]);
1066+ /// Ok(())
10451067/// }
10461068/// ```
10471069#[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1157,9 +1179,10 @@ impl UnixDatagram {
11571179 /// Ok(sock) => sock,
11581180 /// Err(e) => {
11591181 /// println!("Couldn't connect: {:?}", e);
1160- /// return
1182+ /// return Err(e)
11611183 /// }
11621184 /// };
1185+ /// Ok(())
11631186 /// }
11641187 /// ```
11651188 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1189,8 +1212,8 @@ impl UnixDatagram {
11891212 ///
11901213 /// fn main() -> std::io::Result<()> {
11911214 /// let sock = UnixDatagram::bind("/path/to/the/socket")?;
1192- ///
11931215 /// let sock_copy = sock.try_clone().expect("try_clone failed");
1216+ /// Ok(())
11941217 /// }
11951218 /// ```
11961219 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1207,8 +1230,8 @@ impl UnixDatagram {
12071230 ///
12081231 /// fn main() -> std::io::Result<()> {
12091232 /// let sock = UnixDatagram::bind("/path/to/the/socket")?;
1210- ///
12111233 /// let addr = sock.local_addr().expect("Couldn't get local address");
1234+ /// Ok(())
12121235 /// }
12131236 /// ```
12141237 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1232,6 +1255,7 @@ impl UnixDatagram {
12321255 /// sock.connect("/path/to/the/socket")?;
12331256 ///
12341257 /// let addr = sock.peer_addr().expect("Couldn't get peer address");
1258+ /// Ok(())
12351259 /// }
12361260 /// ```
12371261 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1252,10 +1276,9 @@ impl UnixDatagram {
12521276 /// fn main() -> std::io::Result<()> {
12531277 /// let sock = UnixDatagram::unbound()?;
12541278 /// let mut buf = vec![0; 10];
1255- /// match sock.recv_from(buf.as_mut_slice()) {
1256- /// Ok((size, sender)) => println!("received {} bytes from {:?}", size, sender),
1257- /// Err(e) => println!("recv_from function failed: {:?}", e),
1258- /// }
1279+ /// let (size, sender) = sock.recv_from(buf.as_mut_slice())?;
1280+ /// println!("received {} bytes from {:?}", size, sender);
1281+ /// Ok(())
12591282 /// }
12601283 /// ```
12611284 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1295,6 +1318,7 @@ impl UnixDatagram {
12951318 /// let sock = UnixDatagram::bind("/path/to/the/socket")?;
12961319 /// let mut buf = vec![0; 10];
12971320 /// sock.recv(buf.as_mut_slice()).expect("recv function failed");
1321+ /// Ok(())
12981322 /// }
12991323 /// ```
13001324 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1314,6 +1338,7 @@ impl UnixDatagram {
13141338 /// fn main() -> std::io::Result<()> {
13151339 /// let sock = UnixDatagram::unbound()?;
13161340 /// sock.send_to(b"omelette au fromage", "/some/sock").expect("send_to function failed");
1341+ /// Ok(())
13171342 /// }
13181343 /// ```
13191344 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1350,6 +1375,7 @@ impl UnixDatagram {
13501375 /// let sock = UnixDatagram::unbound()?;
13511376 /// sock.connect("/some/sock").expect("Couldn't connect");
13521377 /// sock.send(b"omelette au fromage").expect("send_to function failed");
1378+ /// Ok(())
13531379 /// }
13541380 /// ```
13551381 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1379,6 +1405,7 @@ impl UnixDatagram {
13791405 /// let sock = UnixDatagram::unbound()?;
13801406 /// sock.set_read_timeout(Some(Duration::new(1, 0)))
13811407 /// .expect("set_read_timeout function failed");
1408+ /// Ok(())
13821409 /// }
13831410 /// ```
13841411 ///
@@ -1395,6 +1422,7 @@ impl UnixDatagram {
13951422 /// let result = socket.set_read_timeout(Some(Duration::new(0, 0)));
13961423 /// let err = result.unwrap_err();
13971424 /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
1425+ /// Ok(())
13981426 /// }
13991427 /// ```
14001428 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1423,6 +1451,7 @@ impl UnixDatagram {
14231451 /// let sock = UnixDatagram::unbound()?;
14241452 /// sock.set_write_timeout(Some(Duration::new(1, 0)))
14251453 /// .expect("set_write_timeout function failed");
1454+ /// Ok(())
14261455 /// }
14271456 /// ```
14281457 ///
@@ -1439,6 +1468,7 @@ impl UnixDatagram {
14391468 /// let result = socket.set_write_timeout(Some(Duration::new(0, 0)));
14401469 /// let err = result.unwrap_err();
14411470 /// assert_eq!(err.kind(), io::ErrorKind::InvalidInput)
1471+ /// Ok(())
14421472 /// }
14431473 /// ```
14441474 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1459,6 +1489,7 @@ impl UnixDatagram {
14591489 /// sock.set_read_timeout(Some(Duration::new(1, 0)))
14601490 /// .expect("set_read_timeout function failed");
14611491 /// assert_eq!(sock.read_timeout()?, Some(Duration::new(1, 0)));
1492+ /// Ok(())
14621493 /// }
14631494 /// ```
14641495 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1479,6 +1510,7 @@ impl UnixDatagram {
14791510 /// sock.set_write_timeout(Some(Duration::new(1, 0)))
14801511 /// .expect("set_write_timeout function failed");
14811512 /// assert_eq!(sock.write_timeout()?, Some(Duration::new(1, 0)));
1513+ /// Ok(())
14821514 /// }
14831515 /// ```
14841516 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1496,6 +1528,7 @@ impl UnixDatagram {
14961528 /// fn main() -> std::io::Result<()> {
14971529 /// let sock = UnixDatagram::unbound()?;
14981530 /// sock.set_nonblocking(true).expect("set_nonblocking function failed");
1531+ /// Ok(())
14991532 /// }
15001533 /// ```
15011534 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1515,6 +1548,7 @@ impl UnixDatagram {
15151548 /// if let Ok(Some(err)) = sock.take_error() {
15161549 /// println!("Got error: {:?}", err);
15171550 /// }
1551+ /// Ok(())
15181552 /// }
15191553 /// ```
15201554 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
@@ -1537,6 +1571,7 @@ impl UnixDatagram {
15371571 /// fn main() -> std::io::Result<()> {
15381572 /// let sock = UnixDatagram::unbound()?;
15391573 /// sock.shutdown(Shutdown::Both).expect("shutdown function failed");
1574+ /// Ok(())
15401575 /// }
15411576 /// ```
15421577 #[ stable( feature = "unix_socket" , since = "1.10.0" ) ]
0 commit comments