Skip to content

Commit 97072c6

Browse files
LeSeulArtichautJoshua Nelson
and
Joshua Nelson
committed
Apply suggestions from code review
Co-authored-by: Joshua Nelson <[email protected]>
1 parent 1ababd8 commit 97072c6

File tree

5 files changed

+6
-14
lines changed

5 files changed

+6
-14
lines changed

library/alloc/src/collections/linked_list.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ struct Node<T> {
5050

5151
/// An iterator over the elements of a `LinkedList`.
5252
///
53-
/// This `struct` is created by the [`iter`] method on [`LinkedList`]. See its
53+
/// This `struct` is created by [`LinkedList::iter()`]. See its
5454
/// documentation for more.
55-
///
56-
/// [`iter`]: LinkedList::iter
5755
#[stable(feature = "rust1", since = "1.0.0")]
5856
pub struct Iter<'a, T: 'a> {
5957
head: Option<NonNull<Node<T>>>,
@@ -79,10 +77,8 @@ impl<T> Clone for Iter<'_, T> {
7977

8078
/// A mutable iterator over the elements of a `LinkedList`.
8179
///
82-
/// This `struct` is created by the [`iter_mut`] method on [`LinkedList`]. See its
80+
/// This `struct` is created by [`LinkedList::iter_mut()`]. See its
8381
/// documentation for more.
84-
///
85-
/// [`iter_mut`]: LinkedList::iter_mut
8682
#[stable(feature = "rust1", since = "1.0.0")]
8783
pub struct IterMut<'a, T: 'a> {
8884
// We do *not* exclusively own the entire list here, references to node's `element`

library/alloc/src/fmt.rs

-3
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,6 @@
501501
//! it would internally pass around this structure until it has been determined
502502
//! where output should go to.
503503
//!
504-
//! [`usize`]: core::usize
505-
//! [`isize`]: core::isize
506-
//! [`i8`]: core::i8
507504
//! [`fmt::Result`]: Result
508505
//! [`Result`]: core::result::Result
509506
//! [`std::fmt::Error`]: Error

library/alloc/src/rc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<T> Rc<T> {
393393

394394
/// Returns the inner value, if the `Rc` has exactly one strong reference.
395395
///
396-
/// Otherwise, an [`Err`][Result] is returned with the same `Rc` that was
396+
/// Otherwise, an [`Err`] is returned with the same `Rc` that was
397397
/// passed in.
398398
///
399399
/// This will succeed even if there are outstanding weak references.
@@ -1743,7 +1743,6 @@ impl<T> Weak<T> {
17431743
/// [`into_raw`]: Weak::into_raw
17441744
/// [`upgrade`]: Weak::upgrade
17451745
/// [`new`]: Weak::new
1746-
/// [`forget`]: std::mem::forget
17471746
#[stable(feature = "weak_into_raw", since = "1.45.0")]
17481747
pub unsafe fn from_raw(ptr: *const T) -> Self {
17491748
if ptr.is_null() {

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl String {
492492
/// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
493493
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD], which looks like this: �
494494
///
495-
/// [byteslice]: core::slice
495+
/// [byteslice]: ../../std/primitive.slice.html
496496
/// [U+FFFD]: core::char::REPLACEMENT_CHARACTER
497497
///
498498
/// If you are sure that the byte slice is valid UTF-8, and you don't want

library/alloc/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl<T> Arc<T> {
387387

388388
/// Returns the inner value, if the `Arc` has exactly one strong reference.
389389
///
390-
/// Otherwise, an [`Err`][Result] is returned with the same `Arc` that was
390+
/// Otherwise, an [`Err`] is returned with the same `Arc` that was
391391
/// passed in.
392392
///
393393
/// This will succeed even if there are outstanding weak references.
@@ -1168,7 +1168,7 @@ impl<T: ?Sized> Arc<T> {
11681168
/// Returns a mutable reference into the given `Arc`, if there are
11691169
/// no other `Arc` or [`Weak`] pointers to the same allocation.
11701170
///
1171-
/// Returns [`None`][Option] otherwise, because it is not safe to
1171+
/// Returns [`None`] otherwise, because it is not safe to
11721172
/// mutate a shared value.
11731173
///
11741174
/// See also [`make_mut`][make_mut], which will [`clone`][clone]

0 commit comments

Comments
 (0)