chore(tcp): change the hardcoded port number to port var

The `listen_on` function in the example has a `port` option but doesn't
use it
This commit is contained in:
Sergei Belokon 2023-04-06 18:32:01 +10:00
parent 7f6edd3f15
commit 502cb6f4b9

View File

@ -869,7 +869,7 @@ pub fn incoming(&self) -> Incoming<'_> {
/// 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 */
/// }