From be18a227655b52cd49feeb61cbfe28de8f31a854 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 24 Nov 2019 15:31:28 +0100 Subject: [PATCH] Add missing main() and return value --- src/libstd/sys/unix/ext/net.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index 92b62014406a..5177cce628c9 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -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