Skip to content

Commit

Permalink
doc: fix TcpListener example to compile (#1911)
Browse files Browse the repository at this point in the history
The `process_socket` is hidden from the user which makes the example
fail to compile if copied by the reader.
  • Loading branch information
carllerche authored Dec 6, 2019
1 parent 9c9fabc commit e00c496
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tokio/src/net/tcp/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<()> {
Expand Down

0 comments on commit e00c496

Please sign in to comment.