Skip to content

Commit

Permalink
Add missing main() and return value
Browse files Browse the repository at this point in the history
  • Loading branch information
linkmauve committed Nov 24, 2019
1 parent cdfb5cb commit be18a22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/libstd/sys/unix/ext/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,11 @@ impl UnixStream {
/// use std::os::unix::net::UnixStream;
/// use std::time::Duration;
///
/// let socket = UnixStream::connect("/tmp/sock")?;
/// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
/// 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");
/// Ok(())
/// }
/// ```
///
/// An [`Err`] is returned if the zero [`Duration`] is passed to this
Expand Down

0 comments on commit be18a22

Please sign in to comment.