about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-01-31 23:38:55 +0100
committerGitHub <noreply@github.com>2023-01-31 23:38:55 +0100
commitadc3f8a44b943463577a5f8870da8fd18b749351 (patch)
treebe5ace1b1ff0e992d755e7e241998e6ef3a5ae5b
parent9e0bfe0fb09cdd63660e4fbe0589968ceb9ede0d (diff)
parent943f833314575f0e72b3af287258a49d73ee30e0 (diff)
Rollup merge of #107535 - dcompoze:tcp-doc-unwrap, r=cuviper
Replace unwrap with ? in TcpListener doc

The example in TcpListener doc returns `std::io::Result<()>` but the code inside the function uses `unwrap()` instead of `?`.
-rw-r--r--library/std/src/net/tcp.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs
index 69b72a81c5b..ac09a805975 100644
--- a/library/std/src/net/tcp.rs
+++ b/library/std/src/net/tcp.rs
@@ -829,7 +829,7 @@ impl TcpListener {
     /// }
     ///
     /// fn main() -> std::io::Result<()> {
-    ///     let listener = TcpListener::bind("127.0.0.1:80").unwrap();
+    ///     let listener = TcpListener::bind("127.0.0.1:80")?;
     ///
     ///     for stream in listener.incoming() {
     ///         match stream {