diff options
| author | lukaramu <lukaramu@users.noreply.github.com> | 2017-04-13 20:11:29 +0200 |
|---|---|---|
| committer | lukaramu <lukaramu@users.noreply.github.com> | 2017-04-13 22:51:05 +0200 |
| commit | d64de94efa8a2aeb1a104c367be1b5c03b148987 (patch) | |
| tree | b8af11648e01498020d6c4ddb13a2d7c78aacc9a /src/libcollections/linked_list.rs | |
| parent | ea376822a17dd911244c313c5b07dffdfe3c023a (diff) | |
| download | rust-d64de94efa8a2aeb1a104c367be1b5c03b148987.tar.gz rust-d64de94efa8a2aeb1a104c367be1b5c03b148987.zip | |
Update std::collections' docs to use iterator (etc.) boilerplate
This greatly improves consistency.
Diffstat (limited to 'src/libcollections/linked_list.rs')
| -rw-r--r-- | src/libcollections/linked_list.rs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 1b3eeb837d9..eabf7e47f00 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -56,7 +56,13 @@ struct Node<T> { element: T, } -/// An iterator over references to the elements of a `LinkedList`. +/// An iterator over the elements of a `LinkedList`. +/// +/// This `struct` is created by the [`iter`] method on [`LinkedList`]. See its +/// documentation for more. +/// +/// [`iter`]: struct.LinkedList.html#method.iter +/// [`LinkedList`]: struct.LinkedList.html #[stable(feature = "rust1", since = "1.0.0")] pub struct Iter<'a, T: 'a> { head: Option<Shared<Node<T>>>, @@ -82,7 +88,13 @@ impl<'a, T> Clone for Iter<'a, T> { } } -/// An iterator over mutable references to the elements of a `LinkedList`. +/// A mutable iterator over the elements of a `LinkedList`. +/// +/// This `struct` is created by the [`iter_mut`] method on [`LinkedList`]. See its +/// documentation for more. +/// +/// [`iter_mut`]: struct.LinkedList.html#method.iter_mut +/// [`LinkedList`]: struct.LinkedList.html #[stable(feature = "rust1", since = "1.0.0")] pub struct IterMut<'a, T: 'a> { list: &'a mut LinkedList<T>, @@ -100,7 +112,13 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> { } } -/// An iterator over the elements of a `LinkedList`. +/// An owning iterator over the elements of a `LinkedList`. +/// +/// This `struct` is created by the [`into_iter`] method on [`LinkedList`] +/// (provided by the `IntoIterator` trait). See its documentation for more. +/// +/// [`into_iter`]: struct.LinkedList.html#method.into_iter +/// [`LinkedList`]: struct.LinkedList.html #[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct IntoIter<T> { |
