mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
chore: deny warnings for doc tests (#1539)
This commit is contained in:
@@ -25,7 +25,7 @@ use std::task::{Context, Poll};
|
||||
/// use tokio::net::TcpListener;
|
||||
///
|
||||
/// use std::io;
|
||||
/// # async fn process_socket<T>(socket: T) {}
|
||||
/// # async fn process_socket<T>(_socket: T) {}
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() -> io::Result<()> {
|
||||
@@ -33,7 +33,7 @@ use std::task::{Context, Poll};
|
||||
///
|
||||
/// loop {
|
||||
/// let (socket, _) = listener.accept().await?;
|
||||
/// process_socket(socket);
|
||||
/// process_socket(socket).await;
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
@@ -70,6 +70,7 @@ impl TcpListener {
|
||||
///
|
||||
/// // use the listener
|
||||
///
|
||||
/// # let _ = listener;
|
||||
/// Ok(())
|
||||
/// }
|
||||
/// ```
|
||||
@@ -197,6 +198,7 @@ impl TcpListener {
|
||||
///
|
||||
/// let std_listener = StdTcpListener::bind("127.0.0.1:0")?;
|
||||
/// let listener = TcpListener::from_std(std_listener, &Handle::default())?;
|
||||
/// # let _ = listener;
|
||||
/// # Ok::<_, Box<dyn std::error::Error>>(())
|
||||
/// ```
|
||||
pub fn from_std(listener: net::TcpListener, handle: &Handle) -> io::Result<TcpListener> {
|
||||
|
||||
@@ -270,14 +270,13 @@ impl TcpStream {
|
||||
///
|
||||
/// ```no_run
|
||||
/// use tokio::net::TcpStream;
|
||||
/// use tokio::prelude::*;
|
||||
/// use std::error::Error;
|
||||
/// use std::net::Shutdown;
|
||||
///
|
||||
/// #[tokio::main]
|
||||
/// async fn main() -> Result<(), Box<dyn Error>> {
|
||||
/// // Connect to a peer
|
||||
/// let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
|
||||
/// let stream = TcpStream::connect("127.0.0.1:8080").await?;
|
||||
///
|
||||
/// // Shutdown the stream
|
||||
/// stream.shutdown(Shutdown::Write)?;
|
||||
|
||||
Reference in New Issue
Block a user