From e00c49611af8feced1f5f3c4b9ba7c5081cee9bd Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 6 Dec 2019 09:16:08 -0800 Subject: [PATCH] doc: fix TcpListener example to compile (#1911) The `process_socket` is hidden from the user which makes the example fail to compile if copied by the reader. --- tokio/src/net/tcp/listener.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs index 5a3acd9c1..2cddf24b9 100644 --- a/tokio/src/net/tcp/listener.rs +++ b/tokio/src/net/tcp/listener.rs @@ -18,7 +18,11 @@ cfg_tcp! { /// use tokio::net::TcpListener; /// /// use std::io; - /// # async fn process_socket(_socket: T) {} + /// + /// async fn process_socket(socket: T) { + /// # drop(socket); + /// // do work with socket here + /// } /// /// #[tokio::main] /// async fn main() -> io::Result<()> {