Apply suggestions from code review
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This commit is contained in:
parent
1ababd8794
commit
97072c6b90
5 changed files with 6 additions and 14 deletions
|
@ -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>>>,
|
||||
|
@ -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`
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
@ -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() {
|
||||
|
|
|
@ -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: <20>
|
||||
///
|
||||
/// [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
|
||||
|
|
|
@ -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.
|
||||
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue