Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions library/std/src/os/unix/net/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum AddressKind<'a> {
/// return
/// }
/// };
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixListener::local_addr` should not fail");
/// ```
#[derive(Clone)]
#[stable(feature = "unix_socket", since = "1.10.0")]
Expand Down Expand Up @@ -186,7 +186,7 @@ impl SocketAddr {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixListener::bind("/tmp/sock")?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixListener::local_addr` should not fail");
/// assert_eq!(addr.is_unnamed(), false);
/// Ok(())
/// }
Expand All @@ -200,7 +200,7 @@ impl SocketAddr {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixDatagram::unbound()?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixListener::local_addr` should not fail");
/// assert_eq!(addr.is_unnamed(), true);
/// Ok(())
/// }
Expand All @@ -224,7 +224,7 @@ impl SocketAddr {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixListener::bind("/tmp/sock")?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixListener::local_addr` should not fail");
/// assert_eq!(addr.as_pathname(), Some(Path::new("/tmp/sock")));
/// Ok(())
/// }
Expand All @@ -238,7 +238,7 @@ impl SocketAddr {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixDatagram::unbound()?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixListener::local_addr` should not fail");
/// assert_eq!(addr.as_pathname(), None);
/// Ok(())
/// }
Expand Down
34 changes: 17 additions & 17 deletions library/std/src/os/unix/net/datagram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::bind("/path/to/the/socket")?;
/// let sock_copy = sock.try_clone().expect("try_clone failed");
/// let sock_copy = sock.try_clone().expect("`UnixDatagram::try_clone` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -292,7 +292,7 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::bind("/path/to/the/socket")?;
/// let addr = sock.local_addr().expect("Couldn't get local address");
/// let addr = sock.local_addr().expect("`UnixDatagram::local_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -317,7 +317,7 @@ impl UnixDatagram {
/// let sock = UnixDatagram::unbound()?;
/// sock.connect("/path/to/the/socket")?;
///
/// let addr = sock.peer_addr().expect("Couldn't get peer address");
/// let addr = sock.peer_addr().expect("`UnixDatagram::peer_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -390,7 +390,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::bind("/path/to/the/socket")?;
/// let mut buf = vec![0; 10];
/// sock.recv(buf.as_mut_slice()).expect("recv function failed");
/// sock.recv(buf.as_mut_slice()).expect("`UnixDatagram::recv` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -523,7 +523,7 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.send_to(b"omelette au fromage", "/some/sock").expect("send_to function failed");
/// sock.send_to(b"omelette au fromage", "/some/sock").expect("`UnixDatagram::send_to` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -561,7 +561,7 @@ impl UnixDatagram {
/// let addr = bound.local_addr()?;
///
/// let sock = UnixDatagram::unbound()?;
/// sock.send_to_addr(b"bacon egg and cheese", &addr).expect("send_to_addr function failed");
/// sock.send_to_addr(b"bacon egg and cheese", &addr).expect("`UnixDatagram::send_to_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -595,8 +595,8 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.connect("/some/sock").expect("Couldn't connect");
/// sock.send(b"omelette au fromage").expect("send_to function failed");
/// sock.connect("/some/sock").expect("`UnixDatagram::connect` should not fail");
/// sock.send(b"omelette au fromage").expect("`UnixDatagram` is not connected");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -638,7 +638,7 @@ impl UnixDatagram {
/// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
/// ancillary.add_fds(&fds[..]);
/// sock.send_vectored_with_ancillary_to(bufs, &mut ancillary, "/some/sock")
/// .expect("send_vectored_with_ancillary_to function failed");
/// .expect("`UnixDatagram::send_vectored_with_ancillary_to` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -686,7 +686,7 @@ impl UnixDatagram {
/// let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
/// ancillary.add_fds(&fds[..]);
/// sock.send_vectored_with_ancillary(bufs, &mut ancillary)
/// .expect("send_vectored_with_ancillary function failed");
/// .expect("`UnixDatagram::send_vectored_with_ancillary` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -719,7 +719,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.set_read_timeout(Some(Duration::new(1, 0)))
/// .expect("set_read_timeout function failed");
/// .expect("`UnixDatagram::set_read_timeout` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -765,7 +765,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("set_write_timeout function failed");
/// .expect("`UnixDatagram::set_write_timeout` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -804,7 +804,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.set_read_timeout(Some(Duration::new(1, 0)))
/// .expect("set_read_timeout function failed");
/// .expect("`UnixDatagram::set_read_timeout` should not fail");
/// assert_eq!(sock.read_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
Expand All @@ -826,7 +826,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("set_write_timeout function failed");
/// .expect("`UnixDatagram::set_write_timeout` should not fail");
/// assert_eq!(sock.write_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
Expand All @@ -846,7 +846,7 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.set_nonblocking(true).expect("set_nonblocking function failed");
/// sock.set_nonblocking(true).expect("`UnixDatagram::set_nonblocking` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -914,7 +914,7 @@ impl UnixDatagram {
///
/// fn main() -> std::io::Result<()> {
/// let sock = UnixDatagram::unbound()?;
/// sock.shutdown(Shutdown::Both).expect("shutdown function failed");
/// sock.shutdown(Shutdown::Both).expect("`UnixDatagram::shutdown` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -941,7 +941,7 @@ impl UnixDatagram {
/// fn main() -> std::io::Result<()> {
/// let socket = UnixDatagram::bind("/tmp/sock")?;
/// let mut buf = [0; 10];
/// let len = socket.peek(&mut buf).expect("peek failed");
/// let len = socket.peek(&mut buf).expect("`UnixDatagram::peek` should not fail");
/// Ok(())
/// }
/// ```
Expand Down
6 changes: 3 additions & 3 deletions library/std/src/os/unix/net/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl UnixListener {
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// let listener_copy = listener.try_clone().expect("try_clone failed");
/// let listener_copy = listener.try_clone().expect("`UnixListener::try_clone` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -219,7 +219,7 @@ impl UnixListener {
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// let addr = listener.local_addr().expect("Couldn't get local address");
/// let addr = listener.local_addr().expect("`UnixListener::local_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -244,7 +244,7 @@ impl UnixListener {
///
/// fn main() -> std::io::Result<()> {
/// let listener = UnixListener::bind("/path/to/the/socket")?;
/// listener.set_nonblocking(true).expect("Couldn't set non blocking");
/// listener.set_nonblocking(true).expect("`UnixListener::set_nonblocking` should not fail");
/// Ok(())
/// }
/// ```
Expand Down
22 changes: 11 additions & 11 deletions library/std/src/os/unix/net/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let sock_copy = socket.try_clone().expect("Couldn't clone socket");
/// let sock_copy = socket.try_clone().expect("`UnixStream::try_clone` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -218,7 +218,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let addr = socket.local_addr().expect("Couldn't get local address");
/// let addr = socket.local_addr().expect("`UnixStream::local_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -237,7 +237,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let addr = socket.peer_addr().expect("Couldn't get peer address");
/// let addr = socket.peer_addr().expect("`UnixStream::peer_addr` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -257,7 +257,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let peer_cred = socket.peer_cred().expect("Couldn't get peer credentials");
/// let peer_cred = socket.peer_cred().expect("`UnixStream::peer_cred` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -295,7 +295,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("`UnixStream::set_read_timeout` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -340,7 +340,7 @@ impl UnixStream {
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("Couldn't set write timeout");
/// .expect("`UnixStream::connect` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -378,7 +378,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("`UnixStream::set_read_timeout` should not fail");
/// assert_eq!(socket.read_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
Expand All @@ -400,7 +400,7 @@ impl UnixStream {
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_write_timeout(Some(Duration::new(1, 0)))
/// .expect("Couldn't set write timeout");
/// .expect("`UnixStream::set_write_timeout` should not fail");
/// assert_eq!(socket.write_timeout()?, Some(Duration::new(1, 0)));
/// Ok(())
/// }
Expand All @@ -420,7 +420,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_nonblocking(true).expect("Couldn't set nonblocking");
/// socket.set_nonblocking(true).expect("`UnixStream::set_nonblocking` should not fail");
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -493,7 +493,7 @@ impl UnixStream {
///
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.shutdown(Shutdown::Both).expect("shutdown function failed");
/// socket.shutdown(Shutdown::Both).expect("`UnixStream::shutdown` should not fail");
/// Ok(())
/// }
/// ```
Expand All @@ -520,7 +520,7 @@ impl UnixStream {
/// fn main() -> std::io::Result<()> {
/// let socket = UnixStream::connect("/tmp/sock")?;
/// let mut buf = [0; 10];
/// let len = socket.peek(&mut buf).expect("peek failed");
/// let len = socket.peek(&mut buf).expect("`UnixStream::peek` should not fail");
/// Ok(())
/// }
/// ```
Expand Down
Loading