Add missing main() and return value

This commit is contained in:
Emmanuel Gil Peyrot 2019-11-24 15:31:28 +01:00
parent cdfb5cb4bf
commit be18a22765

View file

@ -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