From 97072c6b9054bbab09fa731948d504a26a1f8377 Mon Sep 17 00:00:00 2001 From: LeSeulArtichaut Date: Fri, 21 Aug 2020 13:09:32 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Joshua Nelson --- library/alloc/src/collections/linked_list.rs | 8 ++------ library/alloc/src/fmt.rs | 3 --- library/alloc/src/rc.rs | 3 +-- library/alloc/src/string.rs | 2 +- library/alloc/src/sync.rs | 4 ++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs index 74155ea66d020..5390b57a1d98d 100644 --- a/library/alloc/src/collections/linked_list.rs +++ b/library/alloc/src/collections/linked_list.rs @@ -50,10 +50,8 @@ struct Node { /// An iterator over the elements of a `LinkedList`. /// -/// This `struct` is created by the [`iter`] method on [`LinkedList`]. See its +/// This `struct` is created by [`LinkedList::iter()`]. See its /// documentation for more. -/// -/// [`iter`]: LinkedList::iter #[stable(feature = "rust1", since = "1.0.0")] pub struct Iter<'a, T: 'a> { head: Option>>, @@ -79,10 +77,8 @@ impl Clone for Iter<'_, T> { /// A mutable iterator over the elements of a `LinkedList`. /// -/// This `struct` is created by the [`iter_mut`] method on [`LinkedList`]. See its +/// This `struct` is created by [`LinkedList::iter_mut()`]. See its /// documentation for more. -/// -/// [`iter_mut`]: LinkedList::iter_mut #[stable(feature = "rust1", since = "1.0.0")] pub struct IterMut<'a, T: 'a> { // We do *not* exclusively own the entire list here, references to node's `element` diff --git a/library/alloc/src/fmt.rs b/library/alloc/src/fmt.rs index 016b5446f4ddb..a886e17f5a9c3 100644 --- a/library/alloc/src/fmt.rs +++ b/library/alloc/src/fmt.rs @@ -501,9 +501,6 @@ //! it would internally pass around this structure until it has been determined //! where output should go to. //! -//! [`usize`]: core::usize -//! [`isize`]: core::isize -//! [`i8`]: core::i8 //! [`fmt::Result`]: Result //! [`Result`]: core::result::Result //! [`std::fmt::Error`]: Error diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index a41592a45b890..f8b1c21e9771c 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -393,7 +393,7 @@ impl Rc { /// Returns the inner value, if the `Rc` has exactly one strong reference. /// - /// Otherwise, an [`Err`][Result] is returned with the same `Rc` that was + /// Otherwise, an [`Err`] is returned with the same `Rc` that was /// passed in. /// /// This will succeed even if there are outstanding weak references. @@ -1743,7 +1743,6 @@ impl Weak { /// [`into_raw`]: Weak::into_raw /// [`upgrade`]: Weak::upgrade /// [`new`]: Weak::new - /// [`forget`]: std::mem::forget #[stable(feature = "weak_into_raw", since = "1.45.0")] pub unsafe fn from_raw(ptr: *const T) -> Self { if ptr.is_null() { diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index 223d6755e26f4..d7d7b6bd157bc 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -492,7 +492,7 @@ impl String { /// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with /// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: � /// - /// [byteslice]: core::slice + /// [byteslice]: ../../std/primitive.slice.html /// [U+FFFD]: core::char::REPLACEMENT_CHARACTER /// /// If you are sure that the byte slice is valid UTF-8, and you don't want diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 6234f6cc32142..4444a7a313298 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -387,7 +387,7 @@ impl Arc { /// Returns the inner value, if the `Arc` has exactly one strong reference. /// - /// Otherwise, an [`Err`][Result] is returned with the same `Arc` that was + /// Otherwise, an [`Err`] is returned with the same `Arc` that was /// passed in. /// /// This will succeed even if there are outstanding weak references. @@ -1168,7 +1168,7 @@ impl Arc { /// Returns a mutable reference into the given `Arc`, if there are /// no other `Arc` or [`Weak`] pointers to the same allocation. /// - /// Returns [`None`][Option] otherwise, because it is not safe to + /// Returns [`None`] otherwise, because it is not safe to /// mutate a shared value. /// /// See also [`make_mut`][make_mut], which will [`clone`][clone]