-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Move to intra-doc links for library/core/src/iter/traits/iterator.rs #76238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bors
merged 6 commits into
rust-lang:master
from
denisvasilik:intra-doc-links-core-iterator
Sep 3, 2020
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
07cd4c8
Use intra-doc links
denisvasilik 7cf0fe1
Apply suggestions from review
denisvasilik 1a438bb
Revert module level documentation link
denisvasilik 3a03589
Revert link removal
denisvasilik 83143a1
Revert link removal of
denisvasilik 89e7fb3
Revert link removal of Some(T)
denisvasilik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,8 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {} | |
/// generally, please see the [module-level documentation]. In particular, you | ||
/// may want to know how to [implement `Iterator`][impl]. | ||
/// | ||
/// [module-level documentation]: index.html | ||
/// [impl]: index.html#implementing-iterator | ||
/// [module-level documentation]: crate::iter | ||
/// [impl]: crate::iter#implementing-iterator | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
#[rustc_on_unimplemented( | ||
on( | ||
|
@@ -212,7 +212,7 @@ pub trait Iterator { | |
/// returning the number of times it saw [`Some`]. Note that [`next`] has to be | ||
/// called at least once even if the iterator does not have any elements. | ||
/// | ||
/// [`next`]: #tymethod.next | ||
/// [`next`]: Iterator::next | ||
/// | ||
/// # Overflow Behavior | ||
/// | ||
|
@@ -449,9 +449,7 @@ pub trait Iterator { | |
/// } | ||
/// ``` | ||
/// | ||
/// [`once`]: fn.once.html | ||
/// [`Iterator`]: trait.Iterator.html | ||
/// [`IntoIterator`]: trait.IntoIterator.html | ||
/// [`once`]: crate::iter::once | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// [`OsStr`]: ../../std/ffi/struct.OsStr.html | ||
#[inline] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
|
@@ -496,9 +494,6 @@ pub trait Iterator { | |
/// [`Iterator`] itself. For example, slices (`&[T]`) implement | ||
/// [`IntoIterator`], and so can be passed to `zip()` directly: | ||
/// | ||
/// [`IntoIterator`]: trait.IntoIterator.html | ||
/// [`Iterator`]: trait.Iterator.html | ||
/// | ||
/// ``` | ||
/// let s1 = &[1, 2, 3]; | ||
/// let s2 = &[4, 5, 6]; | ||
|
@@ -530,8 +525,8 @@ pub trait Iterator { | |
/// assert_eq!((2, 'o'), zipper[2]); | ||
/// ``` | ||
/// | ||
/// [`enumerate`]: #method.enumerate | ||
/// [`next`]: #tymethod.next | ||
/// [`enumerate`]: Iterator::enumerate | ||
/// [`next`]: Iterator::next | ||
#[inline] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
fn zip<U>(self, other: U) -> Zip<Self, U::IntoIter> | ||
|
@@ -734,8 +729,8 @@ pub trait Iterator { | |
/// Why `filter_map` and not just [`filter`] and [`map`]? The key is in this | ||
/// part: | ||
/// | ||
/// [`filter`]: #method.filter | ||
/// [`map`]: #method.map | ||
/// [`filter`]: Iterator::filter | ||
/// [`map`]: Iterator::map | ||
/// | ||
/// > If the closure returns [`Some(element)`][`Some`], then that element is returned. | ||
/// | ||
|
@@ -767,7 +762,6 @@ pub trait Iterator { | |
/// assert_eq!(iter.next(), None); | ||
/// ``` | ||
/// | ||
/// [`Option<T>`]: Option | ||
jyn514 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#[inline] | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> | ||
|
@@ -802,7 +796,7 @@ pub trait Iterator { | |
/// | ||
/// [`usize`]: type@usize | ||
/// [`usize::MAX`]: crate::usize::MAX | ||
/// [`zip`]: #method.zip | ||
/// [`zip`]: Iterator::zip | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -837,8 +831,8 @@ pub trait Iterator { | |
/// anything other than fetching the next value) of the [`next`] method | ||
/// will occur. | ||
/// | ||
/// [`peek`]: crate::iter::Peekable::peek | ||
/// [`next`]: #tymethod.next | ||
/// [`peek`]: Peekable::peek | ||
/// [`next`]: Iterator::next | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -876,7 +870,7 @@ pub trait Iterator { | |
|
||
/// Creates an iterator that [`skip`]s elements based on a predicate. | ||
/// | ||
/// [`skip`]: #method.skip | ||
/// [`skip`]: Iterator::skip | ||
/// | ||
/// `skip_while()` takes a closure as an argument. It will call this | ||
/// closure on each element of the iterator, and ignore elements | ||
|
@@ -1043,8 +1037,8 @@ pub trait Iterator { | |
/// | ||
/// Here's the same example, but with [`take_while`] and [`map`]: | ||
/// | ||
/// [`take_while`]: #method.take_while | ||
/// [`map`]: #method.map | ||
/// [`take_while`]: Iterator::take_while | ||
/// [`map`]: Iterator::map | ||
/// | ||
/// ``` | ||
/// let a = [-1i32, 4, 0, 1]; | ||
|
@@ -1104,7 +1098,7 @@ pub trait Iterator { | |
/// It is also not specified what this iterator returns after the first` None` is returned. | ||
/// If you need fused iterator, use [`fuse`]. | ||
/// | ||
/// [`fuse`]: #method.fuse | ||
/// [`fuse`]: Iterator::fuse | ||
#[inline] | ||
#[unstable(feature = "iter_map_while", reason = "recently added", issue = "68537")] | ||
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> | ||
|
@@ -1190,7 +1184,7 @@ pub trait Iterator { | |
/// An iterator adaptor similar to [`fold`] that holds internal state and | ||
/// produces a new iterator. | ||
/// | ||
/// [`fold`]: #method.fold | ||
/// [`fold`]: Iterator::fold | ||
/// | ||
/// `scan()` takes two arguments: an initial value which seeds the internal | ||
/// state, and a closure with two arguments, the first being a mutable | ||
|
@@ -1246,8 +1240,8 @@ pub trait Iterator { | |
/// one item for each element, and `flat_map()`'s closure returns an | ||
/// iterator for each element. | ||
/// | ||
/// [`map`]: #method.map | ||
/// [`flatten`]: #method.flatten | ||
/// [`map`]: Iterator::map | ||
/// [`flatten`]: Iterator::flatten | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -1333,7 +1327,7 @@ pub trait Iterator { | |
/// two-dimensional and not one-dimensional. To get a one-dimensional | ||
/// structure, you have to `flatten()` again. | ||
/// | ||
/// [`flat_map()`]: #method.flat_map | ||
/// [`flat_map()`]: Iterator::flat_map | ||
#[inline] | ||
#[stable(feature = "iterator_flatten", since = "1.29.0")] | ||
fn flatten(self) -> Flatten<Self> | ||
|
@@ -1350,8 +1344,6 @@ pub trait Iterator { | |
/// [`Some(T)`] again. `fuse()` adapts an iterator, ensuring that after a | ||
/// [`None`] is given, it will always return [`None`] forever. | ||
/// | ||
/// [`Some(T)`]: Some | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broken link, needs to be re-added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is still missing a link. |
||
/// | ||
/// # Examples | ||
/// | ||
/// Basic usage: | ||
|
@@ -1640,7 +1632,7 @@ pub trait Iterator { | |
/// assert_eq!(Ok(vec![1, 3]), result); | ||
/// ``` | ||
/// | ||
/// [`iter`]: #tymethod.next | ||
/// [`iter`]: Iterator::next | ||
/// [`String`]: ../../std/string/struct.String.html | ||
/// [`char`]: type@char | ||
#[inline] | ||
|
@@ -1661,8 +1653,8 @@ pub trait Iterator { | |
/// | ||
/// See also [`is_partitioned()`] and [`partition_in_place()`]. | ||
/// | ||
/// [`is_partitioned()`]: #method.is_partitioned | ||
/// [`partition_in_place()`]: #method.partition_in_place | ||
/// [`is_partitioned()`]: Iterator::is_partitioned | ||
/// [`partition_in_place()`]: Iterator::partition_in_place | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -1716,8 +1708,8 @@ pub trait Iterator { | |
/// | ||
/// See also [`is_partitioned()`] and [`partition()`]. | ||
/// | ||
/// [`is_partitioned()`]: #method.is_partitioned | ||
/// [`partition()`]: #method.partition | ||
/// [`is_partitioned()`]: Iterator::is_partitioned | ||
/// [`partition()`]: Iterator::partition | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -1779,8 +1771,8 @@ pub trait Iterator { | |
/// | ||
/// See also [`partition()`] and [`partition_in_place()`]. | ||
/// | ||
/// [`partition()`]: #method.partition | ||
/// [`partition_in_place()`]: #method.partition_in_place | ||
/// [`partition()`]: Iterator::partition | ||
/// [`partition_in_place()`]: Iterator::partition_in_place | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -1879,8 +1871,8 @@ pub trait Iterator { | |
/// This can also be thought of as the fallible form of [`for_each()`] | ||
/// or as the stateless version of [`try_fold()`]. | ||
/// | ||
/// [`for_each()`]: #method.for_each | ||
/// [`try_fold()`]: #method.try_fold | ||
/// [`for_each()`]: Iterator::for_each | ||
/// [`try_fold()`]: Iterator::try_fold | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -2006,11 +1998,13 @@ pub trait Iterator { | |
accum | ||
} | ||
|
||
/// The same as [`fold()`](#method.fold), but uses the first element in the | ||
/// The same as [`fold()`], but uses the first element in the | ||
/// iterator as the initial value, folding every subsequent element into it. | ||
/// If the iterator is empty, return `None`; otherwise, return the result | ||
/// of the fold. | ||
/// | ||
/// [`fold()`]: Iterator::fold | ||
/// | ||
/// # Example | ||
/// | ||
/// Find the maximum value: | ||
|
@@ -2602,8 +2596,6 @@ pub trait Iterator { | |
/// This is only possible if the iterator has an end, so `rev()` only | ||
/// works on [`DoubleEndedIterator`]s. | ||
/// | ||
/// [`DoubleEndedIterator`]: trait.DoubleEndedIterator.html | ||
/// | ||
/// # Examples | ||
/// | ||
/// ``` | ||
|
@@ -2634,7 +2626,7 @@ pub trait Iterator { | |
/// | ||
/// This function is, in some sense, the opposite of [`zip`]. | ||
/// | ||
/// [`zip`]: #method.zip | ||
/// [`zip`]: Iterator::zip | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -2713,7 +2705,7 @@ pub trait Iterator { | |
/// This is useful when you have an iterator over `&T`, but you need an | ||
/// iterator over `T`. | ||
/// | ||
/// [`clone`]: crate::clone::Clone::clone | ||
/// [`clone`]: Clone::clone | ||
/// | ||
/// # Examples | ||
/// | ||
|
@@ -3197,7 +3189,7 @@ pub trait Iterator { | |
/// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b))); | ||
/// ``` | ||
/// | ||
/// [`is_sorted`]: #method.is_sorted | ||
/// [`is_sorted`]: Iterator::is_sorted | ||
#[unstable(feature = "is_sorted", reason = "new API", issue = "53485")] | ||
fn is_sorted_by<F>(mut self, mut compare: F) -> bool | ||
where | ||
|
@@ -3226,7 +3218,7 @@ pub trait Iterator { | |
/// the elements, as determined by `f`. Apart from that, it's equivalent to [`is_sorted`]; see | ||
/// its documentation for more information. | ||
/// | ||
/// [`is_sorted`]: #method.is_sorted | ||
/// [`is_sorted`]: Iterator::is_sorted | ||
/// | ||
/// # Examples | ||
/// | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.