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.
This commit is contained in:
Carl Lerche
2019-12-06 09:16:08 -08:00
committed by GitHub
parent 9c9fabc44b
commit e00c49611a
+5 -1
View File
@@ -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<()> {