diff options
Diffstat (limited to 'tokio/src/net/tcp/listener.rs')
-rw-r--r-- | tokio/src/net/tcp/listener.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs index 57500615..d3323ae0 100644 --- a/tokio/src/net/tcp/listener.rs +++ b/tokio/src/net/tcp/listener.rs @@ -80,7 +80,7 @@ impl TcpListener { /// method. /// /// The address type can be any implementor of the [`ToSocketAddrs`] trait. - /// Note that strings only implement this trait when the **`dns`** feature + /// Note that strings only implement this trait when the **`net`** feature /// is enabled, as strings may contain domain names that need to be resolved. /// /// If `addr` yields multiple addresses, bind will be attempted with each of @@ -109,25 +109,6 @@ impl TcpListener { /// Ok(()) /// } /// ``` - /// - /// Without the `dns` feature: - /// - /// ```no_run - /// use tokio::net::TcpListener; - /// use std::net::Ipv4Addr; - /// - /// use std::io; - /// - /// #[tokio::main] - /// async fn main() -> io::Result<()> { - /// let listener = TcpListener::bind((Ipv4Addr::new(127, 0, 0, 1), 2345)).await?; - /// - /// // use the listener - /// - /// # let _ = listener; - /// Ok(()) - /// } - /// ``` pub async fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> { let addrs = to_socket_addrs(addr).await?; |