summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaiki Endo <te316e89@gmail.com>2019-09-19 15:50:12 +0900
committerGitHub <noreply@github.com>2019-09-19 15:50:12 +0900
commitd1f60ac4c69792211f9c9f3bcff1559bc0cb837a (patch)
tree8692e2b1b29c8311fff25ad6563be72e9d5853da
parente2161502ad4a8af4845e8286b5b651da27bbd3f6 (diff)
chore: deny warnings for doc tests (#1539)
-rw-r--r--tokio-buf/src/lib.rs5
-rw-r--r--tokio-codec/src/length_delimited.rs4
-rw-r--r--tokio-codec/src/lib.rs5
-rw-r--r--tokio-executor/src/executor.rs2
-rw-r--r--tokio-executor/src/lib.rs5
-rw-r--r--tokio-executor/src/threadpool/blocking.rs2
-rw-r--r--tokio-executor/src/typed.rs2
-rw-r--r--tokio-fs/src/lib.rs5
-rw-r--r--tokio-io/src/lib.rs5
-rw-r--r--tokio-macros/src/lib.rs5
-rw-r--r--tokio-net/src/driver/mod.rs2
-rw-r--r--tokio-net/src/lib.rs5
-rw-r--r--tokio-net/src/tcp/listener.rs6
-rw-r--r--tokio-net/src/tcp/stream.rs3
-rw-r--r--tokio-net/src/util/poll_evented.rs2
-rw-r--r--tokio-sync/src/lib.rs5
-rw-r--r--tokio-sync/src/watch.rs4
-rw-r--r--tokio-test/src/lib.rs5
-rw-r--r--tokio-test/src/macros.rs1
-rw-r--r--tokio-timer/src/lib.rs5
-rw-r--r--tokio-timer/src/timeout.rs12
-rw-r--r--tokio-tls/src/lib.rs5
-rw-r--r--tokio/src/executor.rs2
-rw-r--r--tokio/src/lib.rs5
-rw-r--r--tokio/src/runtime/current_thread/mod.rs8
-rw-r--r--tokio/src/runtime/mod.rs2
-rw-r--r--tokio/src/runtime/threadpool/builder.rs14
-rw-r--r--tokio/src/runtime/threadpool/mod.rs3
-rw-r--r--tokio/src/runtime/threadpool/task_executor.rs2
-rw-r--r--tokio/src/timer.rs3
30 files changed, 81 insertions, 53 deletions
diff --git a/tokio-buf/src/lib.rs b/tokio-buf/src/lib.rs
index 2d45de6d..f9adf8a6 100644
--- a/tokio-buf/src/lib.rs
+++ b/tokio-buf/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Asynchronous stream of bytes.
//!
diff --git a/tokio-codec/src/length_delimited.rs b/tokio-codec/src/length_delimited.rs
index 830499ac..ff3400de 100644
--- a/tokio-codec/src/length_delimited.rs
+++ b/tokio-codec/src/length_delimited.rs
@@ -315,7 +315,6 @@
//! ```
//! # use tokio_io::AsyncWrite;
//! # use tokio_codec::LengthDelimitedCodec;
-//! # use bytes::BytesMut;
//! # fn write_frame<T: AsyncWrite>(io: T) {
//! # let _ =
//! LengthDelimitedCodec::builder()
@@ -842,7 +841,6 @@ impl Builder {
/// # Examples
///
/// ```
- /// # use tokio_io::AsyncRead;
/// use tokio_codec::LengthDelimitedCodec;
/// # pub fn main() {
/// LengthDelimitedCodec::builder()
@@ -892,7 +890,6 @@ impl Builder {
/// ```
/// # use tokio_io::AsyncWrite;
/// # use tokio_codec::LengthDelimitedCodec;
- /// # use bytes::BytesMut;
/// # fn write_frame<T: AsyncWrite>(io: T) {
/// LengthDelimitedCodec::builder()
/// .length_field_length(2)
@@ -914,7 +911,6 @@ impl Builder {
/// ```
/// # use tokio_io::{AsyncRead, AsyncWrite};
/// # use tokio_codec::LengthDelimitedCodec;
- /// # use bytes::BytesMut;
/// # fn write_frame<T: AsyncRead + AsyncWrite>(io: T) {
/// # let _ =
/// LengthDelimitedCodec::builder()
diff --git a/tokio-codec/src/lib.rs b/tokio-codec/src/lib.rs
index 9ac923cc..d70f12ba 100644
--- a/tokio-codec/src/lib.rs
+++ b/tokio-codec/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Utilities for encoding and decoding frames.
//!
diff --git a/tokio-executor/src/executor.rs b/tokio-executor/src/executor.rs
index 3df6bbc2..964a4099 100644
--- a/tokio-executor/src/executor.rs
+++ b/tokio-executor/src/executor.rs
@@ -149,7 +149,7 @@ impl dyn Executor {
/// println!("running on the executor");
/// })).unwrap();
///
- /// handle.map(|_| println!("the future has completed"));
+ /// let handle = handle.map(|_| println!("the future has completed"));
/// # }
/// ```
pub fn spawn_with_handle<Fut>(
diff --git a/tokio-executor/src/lib.rs b/tokio-executor/src/lib.rs
index 74193555..df785d57 100644
--- a/tokio-executor/src/lib.rs
+++ b/tokio-executor/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Task execution related traits and utilities.
//!
diff --git a/tokio-executor/src/threadpool/blocking.rs b/tokio-executor/src/threadpool/blocking.rs
index 091a8392..ebe20747 100644
--- a/tokio-executor/src/threadpool/blocking.rs
+++ b/tokio-executor/src/threadpool/blocking.rs
@@ -104,7 +104,7 @@ pub struct BlockingError {
/// // from the context of a `Future` implementation. Since we don't
/// // have a complicated requirement, we can use `poll_fn` in this
/// // case.
-/// poll_fn(move |_| {
+/// let _ = poll_fn(move |_| {
/// blocking(|| {
/// let msg = rx.recv().unwrap();
/// println!("message = {}", msg);
diff --git a/tokio-executor/src/typed.rs b/tokio-executor/src/typed.rs
index 302ba896..ae22cec2 100644
--- a/tokio-executor/src/typed.rs
+++ b/tokio-executor/src/typed.rs
@@ -63,7 +63,7 @@ use crate::SpawnError;
/// if item.is_none() { break; }
/// }
///
-/// self.tx.take().unwrap().send(()).map_err(|_| ());
+/// let _ = self.tx.take().unwrap().send(()).map_err(|_| ());
/// Poll::Ready(())
/// }
/// }
diff --git a/tokio-fs/src/lib.rs b/tokio-fs/src/lib.rs
index a805cf32..49b7b67d 100644
--- a/tokio-fs/src/lib.rs
+++ b/tokio-fs/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Asynchronous file and standard stream adaptation.
//!
diff --git a/tokio-io/src/lib.rs b/tokio-io/src/lib.rs
index 0e9c5f72..b4fd2c2d 100644
--- a/tokio-io/src/lib.rs
+++ b/tokio-io/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Core I/O traits and combinators when working with Tokio.
//!
diff --git a/tokio-macros/src/lib.rs b/tokio-macros/src/lib.rs
index 5f6ba20b..d92ea8d9 100644
--- a/tokio-macros/src/lib.rs
+++ b/tokio-macros/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Macros for use with Tokio
diff --git a/tokio-net/src/driver/mod.rs b/tokio-net/src/driver/mod.rs
index 381c9e57..a05a2f30 100644
--- a/tokio-net/src/driver/mod.rs
+++ b/tokio-net/src/driver/mod.rs
@@ -23,7 +23,7 @@
//! ```
//! use tokio::net::TcpStream;
//!
-//! # async fn process<T>(t: T) {}
+//! # async fn process<T>(_t: T) {}
//! # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
//! let stream = TcpStream::connect("93.184.216.34:9243").await?;
//!
diff --git a/tokio-net/src/lib.rs b/tokio-net/src/lib.rs
index cd2c6bc3..2fa13b63 100644
--- a/tokio-net/src/lib.rs
+++ b/tokio-net/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Event loop that drives Tokio I/O resources.
//!
diff --git a/tokio-net/src/tcp/listener.rs b/tokio-net/src/tcp/listener.rs
index 81cd71b6..b25f2560 100644
--- a/tokio-net/src/tcp/listener.rs
+++ b/tokio-net/src/tcp/listener.rs
@@ -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> {
diff --git a/tokio-net/src/tcp/stream.rs b/tokio-net/src/tcp/stream.rs
index b5368127..ea841c26 100644
--- a/tokio-net/src/tcp/stream.rs
+++ b/tokio-net/src/tcp/stream.rs
@@ -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)?;
diff --git a/tokio-net/src/util/poll_evented.rs b/tokio-net/src/util/poll_evented.rs
index 29dd94fc..2d94a9b8 100644
--- a/tokio-net/src/util/poll_evented.rs
+++ b/tokio-net/src/util/poll_evented.rs
@@ -76,7 +76,7 @@ use std::task::{Context, Poll};
/// match self.poll_evented.get_ref().accept() {
/// Ok((socket, _)) => Poll::Ready(Ok(socket)),
/// Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
-/// self.poll_evented.clear_read_ready(cx, ready);
+/// self.poll_evented.clear_read_ready(cx, ready)?;
/// Poll::Pending
/// }
/// Err(e) => Poll::Ready(Err(e)),
diff --git a/tokio-sync/src/lib.rs b/tokio-sync/src/lib.rs
index f88229cd..28d1ce74 100644
--- a/tokio-sync/src/lib.rs
+++ b/tokio-sync/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Asynchronous synchronization primitives.
//!
diff --git a/tokio-sync/src/watch.rs b/tokio-sync/src/watch.rs
index 1841fd0a..7b1e6240 100644
--- a/tokio-sync/src/watch.rs
+++ b/tokio-sync/src/watch.rs
@@ -21,7 +21,7 @@
//! use tokio::sync::watch;
//!
//! # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
-//! let (mut tx, mut rx) = watch::channel("hello");
+//! let (tx, mut rx) = watch::channel("hello");
//!
//! tokio::spawn(async move {
//! while let Some(value) = rx.recv().await {
@@ -172,7 +172,7 @@ const CLOSED: usize = 1;
/// use tokio::sync::watch;
///
/// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
-/// let (mut tx, mut rx) = watch::channel("hello");
+/// let (tx, mut rx) = watch::channel("hello");
///
/// tokio::spawn(async move {
/// while let Some(value) = rx.recv().await {
diff --git a/tokio-test/src/lib.rs b/tokio-test/src/lib.rs
index 14bc2826..277308c0 100644
--- a/tokio-test/src/lib.rs
+++ b/tokio-test/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Tokio and Futures based testing utilites
diff --git a/tokio-test/src/macros.rs b/tokio-test/src/macros.rs
index d8b3b2ba..b39b4a02 100644
--- a/tokio-test/src/macros.rs
+++ b/tokio-test/src/macros.rs
@@ -134,7 +134,6 @@ macro_rules! assert_ready_err {
///
/// ```
/// use std::future::Future;
-/// use std::task::Poll;
/// use futures_util::{future, pin_mut};
/// use tokio_test::{assert_pending, task};
///
diff --git a/tokio-timer/src/lib.rs b/tokio-timer/src/lib.rs
index 4fa93385..a8cce26e 100644
--- a/tokio-timer/src/lib.rs
+++ b/tokio-timer/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Utilities for tracking time.
//!
diff --git a/tokio-timer/src/timeout.rs b/tokio-timer/src/timeout.rs
index 250dc828..0b9d0110 100644
--- a/tokio-timer/src/timeout.rs
+++ b/tokio-timer/src/timeout.rs
@@ -38,7 +38,7 @@ use std::time::{Duration, Instant};
/// use std::thread;
/// use std::time::Duration;
///
-/// # async fn dox() {
+/// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
/// let (mut tx, rx) = mpsc::unbounded_channel();
///
/// thread::spawn(move || {
@@ -54,7 +54,8 @@ use std::time::{Duration, Instant};
/// });
///
/// // Wrap the future with a `Timeout` set to expire in 10 milliseconds.
-/// process.timeout(Duration::from_millis(10)).await;
+/// process.timeout(Duration::from_millis(10)).await?;
+/// # Ok(())
/// # }
/// ```
///
@@ -99,13 +100,14 @@ impl<T> Timeout<T> {
///
/// use std::time::Duration;
///
- /// # async fn dox() {
+ /// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
/// let (tx, rx) = oneshot::channel();
/// # tx.send(()).unwrap();
///
/// // Wrap the future with a `Timeout` set to expire in 10 milliseconds.
- /// Timeout::new(rx, Duration::from_millis(10)).await;
- /// }
+ /// Timeout::new(rx, Duration::from_millis(10)).await??;
+ /// # Ok(())
+ /// # }
/// ```
pub fn new(value: T, timeout: Duration) -> Timeout<T> {
let delay = Delay::new_timeout(now() + timeout, timeout);
diff --git a/tokio-tls/src/lib.rs b/tokio-tls/src/lib.rs
index 37c7c2ce..df1e4f85 100644
--- a/tokio-tls/src/lib.rs
+++ b/tokio-tls/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! Async TLS streams
//!
diff --git a/tokio/src/executor.rs b/tokio/src/executor.rs
index 75f0f9d4..710ed2b9 100644
--- a/tokio/src/executor.rs
+++ b/tokio/src/executor.rs
@@ -71,7 +71,7 @@ pub struct Spawn(());
/// ```
/// use tokio::net::TcpListener;
///
-/// # async fn process<T>(t: T) {}
+/// # async fn process<T>(_t: T) {}
/// # async fn dox() -> Result<(), Box<dyn std::error::Error>> {
/// let mut listener = TcpListener::bind("127.0.0.1:8080").await?;
///
diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs
index 68f10bc7..b9758f00 100644
--- a/tokio/src/lib.rs
+++ b/tokio/src/lib.rs
@@ -6,7 +6,10 @@
unreachable_pub
)]
#![deny(intra_doc_link_resolution_failure)]
-#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
+#![doc(test(
+ no_crate_inject,
+ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
+))]
//! A runtime for writing reliable, asynchronous, and slim applications.
//!
diff --git a/tokio/src/runtime/current_thread/mod.rs b/tokio/src/runtime/current_thread/mod.rs
index c4ed70c6..4b237d35 100644
--- a/tokio/src/runtime/current_thread/mod.rs
+++ b/tokio/src/runtime/current_thread/mod.rs
@@ -25,14 +25,13 @@
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
-//! use tokio::prelude::*;
//! use std::thread;
//!
-//! let mut runtime = Runtime::new().unwrap();
+//! let runtime = Runtime::new().unwrap();
//! let handle = runtime.handle();
//!
//! thread::spawn(move || {
-//! handle.spawn(async {
+//! let _ = handle.spawn(async {
//! println!("hello world");
//! });
//! }).join().unwrap();
@@ -45,9 +44,8 @@
//!
//! ```
//! use tokio::runtime::current_thread::Runtime;
-//! use tokio::prelude::*;
//!
-//! let mut runtime = Runtime::new().unwrap();
+//! let runtime = Runtime::new().unwrap();
//!
//! // Use the runtime...
//! // runtime.block_on(f); // where f is a future
diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs
index 4ba6663a..ee33d08c 100644
--- a/tokio/src/runtime/mod.rs
+++ b/tokio/src/runtime/mod.rs
@@ -86,7 +86,7 @@
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create the runtime
-//! let mut rt = Runtime::new()?;
+//! let rt = Runtime::new()?;
//!
//! // Spawn the root task
//! rt.block_on(async {
diff --git a/tokio/src/runtime/threadpool/builder.rs b/tokio/src/runtime/threadpool/builder.rs
index d045c398..13173095 100644
--- a/tokio/src/runtime/threadpool/builder.rs
+++ b/tokio/src/runtime/threadpool/builder.rs
@@ -35,7 +35,7 @@ use std::any::Any;
///
/// fn main() {
/// // build Runtime
-/// let mut runtime = Builder::new()
+/// let runtime = Builder::new()
/// .blocking_threads(4)
/// .clock(Clock::system())
/// .core_threads(4)
@@ -99,7 +99,7 @@ impl Builder {
/// # use tokio::runtime;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .panic_handler(|err| std::panic::resume_unwind(err))
/// .build()
/// .unwrap();
@@ -127,7 +127,7 @@ impl Builder {
/// # use tokio::runtime;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .core_threads(4)
/// .build()
/// .unwrap();
@@ -157,7 +157,7 @@ impl Builder {
/// # use tokio::runtime;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .blocking_threads(200)
/// .build();
/// # }
@@ -186,7 +186,7 @@ impl Builder {
/// use std::time::Duration;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .keep_alive(Some(Duration::from_secs(30)))
/// .build();
/// # }
@@ -210,7 +210,7 @@ impl Builder {
/// # use tokio::runtime;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .name_prefix("my-pool-")
/// .build();
/// # }
@@ -234,7 +234,7 @@ impl Builder {
/// # use tokio::runtime;
///
/// # pub fn main() {
- /// let mut rt = runtime::Builder::new()
+ /// let rt = runtime::Builder::new()
/// .stack_size(32 * 1024)
/// .build();
/// # }
diff --git a/tokio/src/runtime/threadpool/mod.rs b/tokio/src/runtime/threadpool/mod.rs
index c2564cb8..47009cc4 100644
--- a/tokio/src/runtime/threadpool/mod.rs
+++ b/tokio/src/runtime/threadpool/mod.rs
@@ -75,7 +75,6 @@ impl Runtime {
///
/// ```
/// use tokio::runtime::Runtime;
- /// use tokio::prelude::*;
///
/// let rt = Runtime::new()
/// .unwrap();
@@ -198,7 +197,6 @@ impl Runtime {
///
/// ```
/// use tokio::runtime::Runtime;
- /// use tokio::prelude::*;
///
/// let rt = Runtime::new()
/// .unwrap();
@@ -239,7 +237,6 @@ impl Runtime {
///
/// ```
/// use tokio::runtime::Runtime;
- /// use tokio::prelude::*;
///
/// let rt = Runtime::new()
/// .unwrap();
diff --git a/tokio/src/runtime/threadpool/task_executor.rs b/tokio/src/runtime/threadpool/task_executor.rs
index ddf764cc..3107ac11 100644
--- a/tokio/src/runtime/threadpool/task_executor.rs
+++ b/tokio/src/runtime/threadpool/task_executor.rs
@@ -33,7 +33,7 @@ impl TaskExecutor {
///
/// # fn dox() {
/// // Create the runtime
- /// let mut rt = Runtime::new().unwrap();
+ /// let rt = Runtime::new().unwrap();
/// let executor = rt.executor();
///
/// // Spawn a future onto the runtime
diff --git a/tokio/src/timer.rs b/tokio/src/timer.rs
index 024903d5..eaedee27 100644
--- a/tokio/src/timer.rs
+++ b/tokio/src/timer.rs
@@ -30,10 +30,9 @@
//! Wait 100ms and print "Hello World!"
//!
//! ```
-//! use tokio::prelude::*;
//! use tokio::timer::delay;
//!
-//! use std::time::{Duration, Instant};
+//! use std::time::Duration;
//!
//!
//! #[tokio::main]