From 9553355c2709235686030bb1a299dc83a053347c Mon Sep 17 00:00:00 2001 From: xliiv Date: Mon, 13 Apr 2020 17:25:28 +0200 Subject: [PATCH] doc: fix a few broken links (#2400) --- tokio/src/net/tcp/listener.rs | 2 +- tokio/src/runtime/mod.rs | 3 +-- tokio/src/task/local.rs | 8 ++++---- tokio/src/time/delay_queue.rs | 14 +++++++------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/tokio/src/net/tcp/listener.rs b/tokio/src/net/tcp/listener.rs index cde22cb63..aa2ffcf28 100644 --- a/tokio/src/net/tcp/listener.rs +++ b/tokio/src/net/tcp/listener.rs @@ -135,7 +135,7 @@ impl TcpListener { /// established, the corresponding [`TcpStream`] and the remote peer's /// address will be returned. /// - /// [`TcpStream`]: ../struct.TcpStream.html + /// [`TcpStream`]: struct@crate::net::TcpStream /// /// # Examples /// diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index 36b2b442e..516674571 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -245,7 +245,7 @@ use std::time::Duration; /// The Tokio runtime. /// -/// The runtime provides an I/O [driver], task scheduler, [timer], and blocking +/// The runtime provides an I/O driver, task scheduler, [timer], and blocking /// pool, necessary for running asynchronous tasks. /// /// Instances of `Runtime` can be created using [`new`] or [`Builder`]. However, @@ -266,7 +266,6 @@ use std::time::Duration; /// that reactor will no longer function. Calling any method on them will /// result in an error. /// -/// [driver]: crate::io::driver /// [timer]: crate::time /// [mod]: index.html /// [`new`]: #method.new diff --git a/tokio/src/task/local.rs b/tokio/src/task/local.rs index fce467079..edecb04b6 100644 --- a/tokio/src/task/local.rs +++ b/tokio/src/task/local.rs @@ -107,7 +107,7 @@ cfg_rt_util! { /// /// [`Send`]: https://doc.rust-lang.org/std/marker/trait.Send.html /// [local task set]: struct@LocalSet - /// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on + /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on /// [`task::spawn_local`]: fn@spawn_local pub struct LocalSet { /// Current scheduler tick @@ -341,9 +341,9 @@ impl LocalSet { /// ``` /// /// [`spawn_local`]: fn@spawn_local - /// [`Runtime::block_on`]: ../struct.Runtime.html#method.block_on - /// [in-place blocking]: ../blocking/fn.in_place.html - /// [`spawn_blocking`]: ../blocking/fn.spawn_blocking.html + /// [`Runtime::block_on`]: method@crate::runtime::Runtime::block_on + /// [in-place blocking]: fn@crate::task::block_in_place + /// [`spawn_blocking`]: fn@crate::task::spawn_blocking pub fn block_on(&self, rt: &mut crate::runtime::Runtime, future: F) -> F::Output where F: Future, diff --git a/tokio/src/time/delay_queue.rs b/tokio/src/time/delay_queue.rs index 59f901a95..989b42e81 100644 --- a/tokio/src/time/delay_queue.rs +++ b/tokio/src/time/delay_queue.rs @@ -50,13 +50,12 @@ use std::task::{self, Poll}; /// /// # Implementation /// -/// The `DelayQueue` is backed by the same hashed timing wheel implementation as -/// [`Timer`] as such, it offers the same performance benefits. See [`Timer`] -/// for further implementation notes. +/// The [`DelayQueue`] is backed by a separate instance of the same timer wheel used internally by +/// Tokio's standalone timer utilities such as [`delay_for`]. Because of this, it offers the same +/// performance and scalability benefits. /// -/// State associated with each entry is stored in a [`slab`]. This allows -/// amortizing the cost of allocation. Space created for expired entries is -/// reused when inserting new entries. +/// State associated with each entry is stored in a [`slab`]. This amortizes the cost of allocation, +/// and allows reuse of the memory allocated for expired entires. /// /// Capacity can be checked using [`capacity`] and allocated preemptively by using /// the [`reserve`] method. @@ -118,7 +117,8 @@ use std::task::{self, Poll}; /// [`Stream`]: https://docs.rs/futures/0.1/futures/stream/trait.Stream.html /// [`poll`]: #method.poll /// [`Stream::poll`]: #method.poll -/// [`Timer`]: ../struct.Timer.html +/// [`DelayQueue`]: struct@DelayQueue +/// [`delay_for`]: fn@super::delay_for /// [`slab`]: https://docs.rs/slab /// [`capacity`]: #method.capacity /// [`reserve`]: #method.reserve