Skip to content

Commit

Permalink
Rollup merge of rust-lang#109995 - enkron:u/enkron/substitute-hardcod…
Browse files Browse the repository at this point in the history
…ed-port-num-in-listen-on-fn, r=jyn514

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
  • Loading branch information
Noratrieb authored Apr 7, 2023
2 parents fe98885 + 502cb6f commit 33c6e08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(format!("127.0.0.1:{port}")).unwrap();
/// listener.into_incoming()
/// .filter_map(Result::ok) /* Ignore failed connections */
/// }
Expand Down

0 comments on commit 33c6e08

Please sign in to comment.