diff options
| author | bors <bors@rust-lang.org> | 2023-04-08 06:54:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-08 06:54:40 +0000 |
| commit | c49c4fba1168d8a776ef5207ec28000112191ae2 (patch) | |
| tree | bb9ac8e1f1f4524490f99ea39f6fe2225bed2313 | |
| parent | 131211acd2e5519a0ff3e3e8d5f827cddebb1d8a (diff) | |
| parent | 081e222d99be8a5dd795244abafd64cc05e3d00e (diff) | |
| download | rust-c49c4fba1168d8a776ef5207ec28000112191ae2.tar.gz rust-c49c4fba1168d8a776ef5207ec28000112191ae2.zip | |
Auto merge of #109995 - enkron:u/enkron/substitute-hardcoded-port-num-in-listen-on-fn, r=the8472
chore(tcp): change a hardcoded port number in a doctest to `port` var The `listen_on` function in the example has a `port` option but doesn't use it
| -rw-r--r-- | library/std/src/net/tcp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/net/tcp.rs b/library/std/src/net/tcp.rs index 3982d363661..4b42ad65ee6 100644 --- a/library/std/src/net/tcp.rs +++ b/library/std/src/net/tcp.rs @@ -869,7 +869,7 @@ impl TcpListener { /// use std::net::{TcpListener, TcpStream}; /// /// fn listen_on(port: u16) -> impl Iterator<Item = TcpStream> { - /// let listener = TcpListener::bind("127.0.0.1:80").unwrap(); + /// let listener = TcpListener::bind(("127.0.0.1", port)).unwrap(); /// listener.into_incoming() /// .filter_map(Result::ok) /* Ignore failed connections */ /// } |
