From e7d074392e560517546725e7e3ba5b3fe8978ee8 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Tue, 1 Sep 2020 19:20:15 +0200 Subject: [PATCH 1/2] Use intra-doc links --- library/core/src/clone.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 7784ec687ea9a..a5d20045a9b04 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -7,11 +7,7 @@ //! contain owned boxes or implement [`Drop`]), so the compiler considers //! them cheap and safe to copy. For other types copies must be made //! explicitly, by convention implementing the [`Clone`] trait and calling -//! the [`clone`][clone] method. -//! -//! [`Clone`]: trait.Clone.html -//! [clone]: trait.Clone.html#tymethod.clone -//! [`Drop`]: ../../std/ops/trait.Drop.html +//! the [`Clone::clone`] method. //! //! Basic usage example: //! @@ -51,7 +47,7 @@ /// ## Derivable /// /// This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d -/// implementation of [`clone`] calls [`clone`] on each field. +/// implementation of [`Clone::clone`] calls [`Clone::clone`] on each field. /// /// For a generic struct, `#[derive]` implements `Clone` conditionally by adding bound `Clone` on /// generic parameters. @@ -74,9 +70,6 @@ /// An example is a generic struct holding a function pointer. In this case, the /// implementation of `Clone` cannot be `derive`d, but can be implemented as: /// -/// [`Copy`]: ../../std/marker/trait.Copy.html -/// [`clone`]: trait.Clone.html#tymethod.clone -/// /// ``` /// struct Generate(fn() -> T); /// From 3510c568874eb1274805b25cfa5cc54aa1819030 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Tue, 1 Sep 2020 19:56:32 +0200 Subject: [PATCH 2/2] Improve readability --- library/core/src/clone.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index a5d20045a9b04..a953a3a4182bc 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -7,7 +7,9 @@ //! contain owned boxes or implement [`Drop`]), so the compiler considers //! them cheap and safe to copy. For other types copies must be made //! explicitly, by convention implementing the [`Clone`] trait and calling -//! the [`Clone::clone`] method. +//! the [`clone`] method. +//! +//! [`clone`]: Clone::clone //! //! Basic usage example: //! @@ -47,7 +49,9 @@ /// ## Derivable /// /// This trait can be used with `#[derive]` if all fields are `Clone`. The `derive`d -/// implementation of [`Clone::clone`] calls [`Clone::clone`] on each field. +/// implementation of [`Clone`] calls [`clone`] on each field. +/// +/// [`clone`]: Clone::clone /// /// For a generic struct, `#[derive]` implements `Clone` conditionally by adding bound `Clone` on /// generic parameters.