Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Joshua Nelson <[email protected]>
  • Loading branch information
LeSeulArtichaut and Joshua Nelson committed Aug 21, 2020
1 parent 1ababd8 commit 97072c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
8 changes: 2 additions & 6 deletions library/alloc/src/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ struct Node<T> {

/// 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<NonNull<Node<T>>>,
Expand All @@ -79,10 +77,8 @@ impl<T> 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`
Expand Down
3 changes: 0 additions & 3 deletions library/alloc/src/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ impl<T> Rc<T> {

/// 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.
Expand Down Expand Up @@ -1743,7 +1743,6 @@ impl<T> Weak<T> {
/// [`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() {
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl<T> Arc<T> {

/// 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.
Expand Down Expand Up @@ -1168,7 +1168,7 @@ impl<T: ?Sized> Arc<T> {
/// 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]
Expand Down

0 comments on commit 97072c6

Please sign in to comment.