We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cdfb5cb commit be18a22Copy full SHA for be18a22
src/libstd/sys/unix/ext/net.rs
@@ -415,8 +415,11 @@ impl UnixStream {
415
/// use std::os::unix::net::UnixStream;
416
/// use std::time::Duration;
417
///
418
- /// let socket = UnixStream::connect("/tmp/sock")?;
419
- /// 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")?;
420
+ /// socket.set_read_timeout(Some(Duration::new(1, 0))).expect("Couldn't set read timeout");
421
+ /// Ok(())
422
+ /// }
423
/// ```
424
425
/// An [`Err`] is returned if the zero [`Duration`] is passed to this
0 commit comments