From 7dba693f0e1197098ff10ac8812e1681cc79297e Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Sun, 9 Aug 2020 23:06:44 +0200 Subject: [PATCH 1/2] Use intra-doc links --- library/core/src/borrow.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/library/core/src/borrow.rs b/library/core/src/borrow.rs index 3e533255bec..8d52fb2ad8f 100644 --- a/library/core/src/borrow.rs +++ b/library/core/src/borrow.rs @@ -40,14 +40,13 @@ /// provide a reference to related type `T`, it is often better to use /// [`AsRef`] as more types can safely implement it. /// -/// [`AsRef`]: ../../std/convert/trait.AsRef.html -/// [`BorrowMut`]: trait.BorrowMut.html +/// [`AsRef`]: crate::convert::AsRef +/// [`BorrowMut`]: BorrowMut /// [`Box`]: ../../std/boxed/struct.Box.html /// [`Mutex`]: ../../std/sync/struct.Mutex.html /// [`Rc`]: ../../std/rc/struct.Rc.html -/// [`str`]: ../../std/primitive.str.html /// [`String`]: ../../std/string/struct.String.html -/// [`borrow`]: #tymethod.borrow +/// [`borrow`]: Borrow::borrow /// /// # Examples /// @@ -152,10 +151,9 @@ /// If it wants to allow others access to the underlying `str`, it can do /// that via `AsRef` which doesn’t carry any extra requirements. /// -/// [`Hash`]: ../../std/hash/trait.Hash.html +/// [`Hash`]: crate::hash::Hash /// [`HashMap`]: ../../std/collections/struct.HashMap.html /// [`String`]: ../../std/string/struct.String.html -/// [`str`]: ../../std/primitive.str.html #[stable(feature = "rust1", since = "1.0.0")] pub trait Borrow { /// Immutably borrows from an owned value. @@ -187,7 +185,7 @@ pub trait Borrow { /// an underlying type by providing a mutable reference. See [`Borrow`] /// for more information on borrowing as another type. /// -/// [`Borrow`]: trait.Borrow.html +/// [`Borrow`]: Borrow #[stable(feature = "rust1", since = "1.0.0")] pub trait BorrowMut: Borrow { /// Mutably borrows from an owned value. From d7e72710853983372bf64aef905f1c273b75d365 Mon Sep 17 00:00:00 2001 From: Denis Vasilik Date: Mon, 10 Aug 2020 20:29:20 +0200 Subject: [PATCH 2/2] Remove AsRef link as it is in the prelude --- library/core/src/borrow.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/library/core/src/borrow.rs b/library/core/src/borrow.rs index 8d52fb2ad8f..6f5a6aa7c79 100644 --- a/library/core/src/borrow.rs +++ b/library/core/src/borrow.rs @@ -40,7 +40,6 @@ /// provide a reference to related type `T`, it is often better to use /// [`AsRef`] as more types can safely implement it. /// -/// [`AsRef`]: crate::convert::AsRef /// [`BorrowMut`]: BorrowMut /// [`Box`]: ../../std/boxed/struct.Box.html /// [`Mutex`]: ../../std/sync/struct.Mutex.html