chore: deny warnings for doc tests (#1539)

This commit is contained in:
Taiki Endo
2019-09-19 15:50:12 +09:00
committed by GitHub
parent e2161502ad
commit d1f60ac4c6
30 changed files with 81 additions and 53 deletions
+4 -2
View File
@@ -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> {
+1 -2
View File
@@ -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)?;