mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
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:
@@ -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<()> {
|
||||
|
||||
Reference in New Issue
Block a user