diff options
author | Carl Lerche <me@carllerche.com> | 2019-12-06 09:16:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 09:16:08 -0800 |
commit | e00c49611af8feced1f5f3c4b9ba7c5081cee9bd (patch) | |
tree | d1ef9a8806ceb61da7ed78298899e364295738c3 /tokio/src/net | |
parent | 9c9fabc44b317765b5ea618201ce05392256b067 (diff) |
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.
Diffstat (limited to 'tokio/src/net')
-rw-r--r-- | tokio/src/net/tcp/listener.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs index 5a3acd9c..2cddf24b 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<T>(_socket: T) {} + /// + /// async fn process_socket<T>(socket: T) { + /// # drop(socket); + /// // do work with socket here + /// } /// /// #[tokio::main] /// async fn main() -> io::Result<()> { |