From c3748e5d904e0b7bf20ea0e3b068f463b92a043f Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Wed, 23 Aug 2023 10:57:10 +0900 Subject: [PATCH] Fix rustdoc::redundant_explicit_links warning (#2769) --- futures-channel/src/mpsc/mod.rs | 13 ++++++------- futures-channel/src/oneshot.rs | 18 +++++++++--------- futures-test/src/lib.rs | 2 +- futures-test/src/task/mod.rs | 20 ++++++++++---------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/futures-channel/src/mpsc/mod.rs b/futures-channel/src/mpsc/mod.rs index ddf2340425..64f7526fa4 100644 --- a/futures-channel/src/mpsc/mod.rs +++ b/futures-channel/src/mpsc/mod.rs @@ -119,12 +119,12 @@ impl Unpin for BoundedSenderInner {} /// The transmission end of a bounded mpsc channel. /// -/// This value is created by the [`channel`](channel) function. +/// This value is created by the [`channel`] function. pub struct Sender(Option>); /// The transmission end of an unbounded mpsc channel. /// -/// This value is created by the [`unbounded`](unbounded) function. +/// This value is created by the [`unbounded`] function. pub struct UnboundedSender(Option>); trait AssertKinds: Send + Sync + Clone {} @@ -132,14 +132,14 @@ impl AssertKinds for UnboundedSender {} /// The receiving end of a bounded mpsc channel. /// -/// This value is created by the [`channel`](channel) function. +/// This value is created by the [`channel`] function. pub struct Receiver { inner: Option>>, } /// The receiving end of an unbounded mpsc channel. /// -/// This value is created by the [`unbounded`](unbounded) function. +/// This value is created by the [`unbounded`] function. pub struct UnboundedReceiver { inner: Option>>, } @@ -343,9 +343,8 @@ impl SenderTask { /// guaranteed slot in the channel capacity, and on top of that there are /// `buffer` "first come, first serve" slots available to all senders. /// -/// The [`Receiver`](Receiver) returned implements the -/// [`Stream`](futures_core::stream::Stream) trait, while [`Sender`](Sender) implements -/// `Sink`. +/// The [`Receiver`] returned implements the [`Stream`] trait, while [`Sender`] +/// implements `Sink`. pub fn channel(buffer: usize) -> (Sender, Receiver) { // Check that the requested buffer size does not exceed the maximum buffer // size permitted by the system. diff --git a/futures-channel/src/oneshot.rs b/futures-channel/src/oneshot.rs index 70449f43d6..fe5b115a33 100644 --- a/futures-channel/src/oneshot.rs +++ b/futures-channel/src/oneshot.rs @@ -14,7 +14,7 @@ use crate::lock::Lock; /// A future for a value that will be provided by another asynchronous task. /// -/// This is created by the [`channel`](channel) function. +/// This is created by the [`channel`] function. #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct Receiver { inner: Arc>, @@ -22,7 +22,7 @@ pub struct Receiver { /// A means of transmitting a single value to another task. /// -/// This is created by the [`channel`](channel) function. +/// This is created by the [`channel`] function. pub struct Sender { inner: Arc>, } @@ -332,8 +332,8 @@ impl Sender { /// Completes this oneshot with a successful result. /// /// This function will consume `self` and indicate to the other end, the - /// [`Receiver`](Receiver), that the value provided is the result of the - /// computation this represents. + /// [`Receiver`], that the value provided is the result of the computation + /// this represents. /// /// If the value is successfully enqueued for the remote end to receive, /// then `Ok(())` is returned. If the receiving end was dropped before @@ -343,7 +343,7 @@ impl Sender { } /// Polls this `Sender` half to detect whether its associated - /// [`Receiver`](Receiver) has been dropped. + /// [`Receiver`] has been dropped. /// /// # Return values /// @@ -359,10 +359,10 @@ impl Sender { } /// Creates a future that resolves when this `Sender`'s corresponding - /// [`Receiver`](Receiver) half has hung up. + /// [`Receiver`] half has hung up. /// /// This is a utility wrapping [`poll_canceled`](Sender::poll_canceled) - /// to expose a [`Future`](core::future::Future). + /// to expose a [`Future`]. pub fn cancellation(&mut self) -> Cancellation<'_, T> { Cancellation { inner: self } } @@ -413,8 +413,8 @@ impl Future for Cancellation<'_, T> { } } -/// Error returned from a [`Receiver`](Receiver) when the corresponding -/// [`Sender`](Sender) is dropped. +/// Error returned from a [`Receiver`] when the corresponding [`Sender`] is +/// dropped. #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct Canceled; diff --git a/futures-test/src/lib.rs b/futures-test/src/lib.rs index 2eb4a1c4cd..49f834846e 100644 --- a/futures-test/src/lib.rs +++ b/futures-test/src/lib.rs @@ -61,7 +61,7 @@ mod interleave_pending; mod track_closed; /// Enables an `async` test function. The generated future will be run to completion with -/// [`futures_executor::block_on`](futures_executor::block_on). +/// [`futures_executor::block_on`]. /// /// ``` /// #[futures_test::test] diff --git a/futures-test/src/task/mod.rs b/futures-test/src/task/mod.rs index 118291c0c9..e10ecbb875 100644 --- a/futures-test/src/task/mod.rs +++ b/futures-test/src/task/mod.rs @@ -15,29 +15,29 @@ //! [`Spawn`](futures_task::Spawn) implementations. //! //! Test contexts: -//! - [`noop_context`](crate::task::noop_context) creates a context that ignores calls to +//! - [`noop_context`] creates a context that ignores calls to //! [`cx.waker().wake_by_ref()`](futures_core::task::Waker). -//! - [`panic_context`](crate::task::panic_context) creates a context that panics when +//! - [`panic_context`] creates a context that panics when //! [`cx.waker().wake_by_ref()`](futures_core::task::Waker) is called. //! //! Test wakers: -//! - [`noop_waker`](crate::task::noop_waker) creates a waker that ignores calls to +//! - [`noop_waker`] creates a waker that ignores calls to //! [`wake`](futures_core::task::Waker). -//! - [`panic_waker`](crate::task::panic_waker()) creates a waker that panics when +//! - [`panic_waker`](panic_waker()) creates a waker that panics when //! [`wake`](futures_core::task::Waker) is called. -//! - [`new_count_waker`](crate::task::new_count_waker) creates a waker that increments a counter whenever +//! - [`new_count_waker`] creates a waker that increments a counter whenever //! [`wake`](futures_core::task::Waker) is called. //! //! Test spawners: -//! - [`NoopSpawner`](crate::task::NoopSpawner) ignores calls to +//! - [`NoopSpawner`] ignores calls to //! [`spawn`](futures_util::task::SpawnExt::spawn) -//! - [`PanicSpawner`](crate::task::PanicSpawner) panics if [`spawn`](futures_util::task::SpawnExt::spawn) is +//! - [`PanicSpawner`] panics if [`spawn`](futures_util::task::SpawnExt::spawn) is //! called. -//! - [`RecordSpawner`](crate::task::RecordSpawner) records the spawned futures. +//! - [`RecordSpawner`] records the spawned futures. //! //! For convenience there additionally exist various functions that directly -//! return waker/spawner references: [`noop_waker_ref`](crate::task::noop_waker_ref), -//! [`panic_waker_ref`](crate::task::panic_waker_ref), [`noop_spawner_mut`](crate::task::noop_spawner_mut) and [`panic_spawner_mut`](crate::task::panic_spawner_mut). +//! return waker/spawner references: [`noop_waker_ref`], [`panic_waker_ref`], +//! [`noop_spawner_mut`] and [`panic_spawner_mut`]. mod context; pub use self::context::{noop_context, panic_context};