Skip to content

Commit be18a22

Browse files
committed
Add missing main() and return value
1 parent cdfb5cb commit be18a22

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libstd/sys/unix/ext/net.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,11 @@ impl UnixStream {
415415
/// use std::os::unix::net::UnixStream;
416416
/// use std::time::Duration;
417417
///
418-
/// let socket = UnixStream::connect("/tmp/sock")?;
419-
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
418+
/// fn main() -> std::io::Result<()> {
419+
/// let socket = UnixStream::connect("/tmp/sock")?;
420+
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
421+
/// Ok(())
422+
/// }
420423
/// ```
421424
///
422425
/// An [`Err`] is returned if the zero [`Duration`] is passed to this

0 commit comments

Comments
 (0)