Skip to content

Commit c49c4fb

Browse files
committed
Auto merge of rust-lang#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
2 parents 131211a + 081e222 commit c49c4fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: library/std/src/net/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ impl TcpListener {
869869
/// use std::net::{TcpListener, TcpStream};
870870
///
871871
/// fn listen_on(port: u16) -> impl Iterator<Item = TcpStream> {
872-
/// let listener = TcpListener::bind("127.0.0.1:80").unwrap();
872+
/// let listener = TcpListener::bind(("127.0.0.1", port)).unwrap();
873873
/// listener.into_incoming()
874874
/// .filter_map(Result::ok) /* Ignore failed connections */
875875
/// }

0 commit comments

Comments
 (0)