@@ -21,8 +21,8 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}
21
21
/// generally, please see the [module-level documentation]. In particular, you
22
22
/// may want to know how to [implement `Iterator`][impl].
23
23
///
24
- /// [module-level documentation]: index.html
25
- /// [impl]: index.html #implementing-iterator
24
+ /// [module-level documentation]: crate::iter
25
+ /// [impl]: crate::iter #implementing-iterator
26
26
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27
27
#[ rustc_on_unimplemented(
28
28
on(
@@ -211,7 +211,7 @@ pub trait Iterator {
211
211
/// returning the number of times it saw [`Some`]. Note that [`next`] has to be
212
212
/// called at least once even if the iterator does not have any elements.
213
213
///
214
- /// [`next`]: #tymethod. next
214
+ /// [`next`]: Iterator:: next
215
215
///
216
216
/// # Overflow Behavior
217
217
///
@@ -448,9 +448,7 @@ pub trait Iterator {
448
448
/// }
449
449
/// ```
450
450
///
451
- /// [`once`]: fn.once.html
452
- /// [`Iterator`]: trait.Iterator.html
453
- /// [`IntoIterator`]: trait.IntoIterator.html
451
+ /// [`once`]: crate::iter::once
454
452
/// [`OsStr`]: ../../std/ffi/struct.OsStr.html
455
453
#[ inline]
456
454
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -495,9 +493,6 @@ pub trait Iterator {
495
493
/// [`Iterator`] itself. For example, slices (`&[T]`) implement
496
494
/// [`IntoIterator`], and so can be passed to `zip()` directly:
497
495
///
498
- /// [`IntoIterator`]: trait.IntoIterator.html
499
- /// [`Iterator`]: trait.Iterator.html
500
- ///
501
496
/// ```
502
497
/// let s1 = &[1, 2, 3];
503
498
/// let s2 = &[4, 5, 6];
@@ -529,8 +524,8 @@ pub trait Iterator {
529
524
/// assert_eq!((2, 'o'), zipper[2]);
530
525
/// ```
531
526
///
532
- /// [`enumerate`]: #method. enumerate
533
- /// [`next`]: #tymethod. next
527
+ /// [`enumerate`]: Iterator:: enumerate
528
+ /// [`next`]: Iterator:: next
534
529
#[ inline]
535
530
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
536
531
fn zip < U > ( self , other : U ) -> Zip < Self , U :: IntoIter >
@@ -733,8 +728,8 @@ pub trait Iterator {
733
728
/// Why `filter_map` and not just [`filter`] and [`map`]? The key is in this
734
729
/// part:
735
730
///
736
- /// [`filter`]: #method. filter
737
- /// [`map`]: #method. map
731
+ /// [`filter`]: Iterator:: filter
732
+ /// [`map`]: Iterator:: map
738
733
///
739
734
/// > If the closure returns [`Some(element)`][`Some`], then that element is returned.
740
735
///
@@ -801,7 +796,7 @@ pub trait Iterator {
801
796
///
802
797
/// [`usize`]: type@usize
803
798
/// [`usize::MAX`]: crate::usize::MAX
804
- /// [`zip`]: #method. zip
799
+ /// [`zip`]: Iterator:: zip
805
800
///
806
801
/// # Examples
807
802
///
@@ -836,8 +831,8 @@ pub trait Iterator {
836
831
/// anything other than fetching the next value) of the [`next`] method
837
832
/// will occur.
838
833
///
839
- /// [`peek`]: crate::iter:: Peekable::peek
840
- /// [`next`]: #tymethod. next
834
+ /// [`peek`]: Peekable::peek
835
+ /// [`next`]: Iterator:: next
841
836
///
842
837
/// # Examples
843
838
///
@@ -875,7 +870,7 @@ pub trait Iterator {
875
870
876
871
/// Creates an iterator that [`skip`]s elements based on a predicate.
877
872
///
878
- /// [`skip`]: #method. skip
873
+ /// [`skip`]: Iterator:: skip
879
874
///
880
875
/// `skip_while()` takes a closure as an argument. It will call this
881
876
/// closure on each element of the iterator, and ignore elements
@@ -1042,8 +1037,8 @@ pub trait Iterator {
1042
1037
///
1043
1038
/// Here's the same example, but with [`take_while`] and [`map`]:
1044
1039
///
1045
- /// [`take_while`]: #method. take_while
1046
- /// [`map`]: #method. map
1040
+ /// [`take_while`]: Iterator:: take_while
1041
+ /// [`map`]: Iterator:: map
1047
1042
///
1048
1043
/// ```
1049
1044
/// let a = [-1i32, 4, 0, 1];
@@ -1103,7 +1098,7 @@ pub trait Iterator {
1103
1098
/// It is also not specified what this iterator returns after the first` None` is returned.
1104
1099
/// If you need fused iterator, use [`fuse`].
1105
1100
///
1106
- /// [`fuse`]: #method. fuse
1101
+ /// [`fuse`]: Iterator:: fuse
1107
1102
#[ inline]
1108
1103
#[ unstable( feature = "iter_map_while" , reason = "recently added" , issue = "68537" ) ]
1109
1104
fn map_while < B , P > ( self , predicate : P ) -> MapWhile < Self , P >
@@ -1189,7 +1184,7 @@ pub trait Iterator {
1189
1184
/// An iterator adaptor similar to [`fold`] that holds internal state and
1190
1185
/// produces a new iterator.
1191
1186
///
1192
- /// [`fold`]: #method. fold
1187
+ /// [`fold`]: Iterator:: fold
1193
1188
///
1194
1189
/// `scan()` takes two arguments: an initial value which seeds the internal
1195
1190
/// state, and a closure with two arguments, the first being a mutable
@@ -1245,8 +1240,8 @@ pub trait Iterator {
1245
1240
/// one item for each element, and `flat_map()`'s closure returns an
1246
1241
/// iterator for each element.
1247
1242
///
1248
- /// [`map`]: #method. map
1249
- /// [`flatten`]: #method. flatten
1243
+ /// [`map`]: Iterator:: map
1244
+ /// [`flatten`]: Iterator:: flatten
1250
1245
///
1251
1246
/// # Examples
1252
1247
///
@@ -1332,7 +1327,7 @@ pub trait Iterator {
1332
1327
/// two-dimensional and not one-dimensional. To get a one-dimensional
1333
1328
/// structure, you have to `flatten()` again.
1334
1329
///
1335
- /// [`flat_map()`]: #method. flat_map
1330
+ /// [`flat_map()`]: Iterator:: flat_map
1336
1331
#[ inline]
1337
1332
#[ stable( feature = "iterator_flatten" , since = "1.29.0" ) ]
1338
1333
fn flatten ( self ) -> Flatten < Self >
@@ -1639,7 +1634,7 @@ pub trait Iterator {
1639
1634
/// assert_eq!(Ok(vec![1, 3]), result);
1640
1635
/// ```
1641
1636
///
1642
- /// [`iter`]: #tymethod. next
1637
+ /// [`iter`]: Iterator:: next
1643
1638
/// [`String`]: ../../std/string/struct.String.html
1644
1639
/// [`char`]: type@char
1645
1640
#[ inline]
@@ -1660,8 +1655,8 @@ pub trait Iterator {
1660
1655
///
1661
1656
/// See also [`is_partitioned()`] and [`partition_in_place()`].
1662
1657
///
1663
- /// [`is_partitioned()`]: #method. is_partitioned
1664
- /// [`partition_in_place()`]: #method. partition_in_place
1658
+ /// [`is_partitioned()`]: Iterator:: is_partitioned
1659
+ /// [`partition_in_place()`]: Iterator:: partition_in_place
1665
1660
///
1666
1661
/// # Examples
1667
1662
///
@@ -1715,8 +1710,8 @@ pub trait Iterator {
1715
1710
///
1716
1711
/// See also [`is_partitioned()`] and [`partition()`].
1717
1712
///
1718
- /// [`is_partitioned()`]: #method. is_partitioned
1719
- /// [`partition()`]: #method. partition
1713
+ /// [`is_partitioned()`]: Iterator:: is_partitioned
1714
+ /// [`partition()`]: Iterator:: partition
1720
1715
///
1721
1716
/// # Examples
1722
1717
///
@@ -1778,8 +1773,8 @@ pub trait Iterator {
1778
1773
///
1779
1774
/// See also [`partition()`] and [`partition_in_place()`].
1780
1775
///
1781
- /// [`partition()`]: #method. partition
1782
- /// [`partition_in_place()`]: #method. partition_in_place
1776
+ /// [`partition()`]: Iterator:: partition
1777
+ /// [`partition_in_place()`]: Iterator:: partition_in_place
1783
1778
///
1784
1779
/// # Examples
1785
1780
///
@@ -1878,8 +1873,8 @@ pub trait Iterator {
1878
1873
/// This can also be thought of as the fallible form of [`for_each()`]
1879
1874
/// or as the stateless version of [`try_fold()`].
1880
1875
///
1881
- /// [`for_each()`]: #method. for_each
1882
- /// [`try_fold()`]: #method. try_fold
1876
+ /// [`for_each()`]: Iterator:: for_each
1877
+ /// [`try_fold()`]: Iterator:: try_fold
1883
1878
///
1884
1879
/// # Examples
1885
1880
///
@@ -2005,11 +2000,13 @@ pub trait Iterator {
2005
2000
accum
2006
2001
}
2007
2002
2008
- /// The same as [`fold()`](#method.fold) , but uses the first element in the
2003
+ /// The same as [`fold()`], but uses the first element in the
2009
2004
/// iterator as the initial value, folding every subsequent element into it.
2010
2005
/// If the iterator is empty, return `None`; otherwise, return the result
2011
2006
/// of the fold.
2012
2007
///
2008
+ /// [`fold()`]: Iterator::fold
2009
+ ///
2013
2010
/// # Example
2014
2011
///
2015
2012
/// Find the maximum value:
@@ -2607,8 +2604,6 @@ pub trait Iterator {
2607
2604
/// This is only possible if the iterator has an end, so `rev()` only
2608
2605
/// works on [`DoubleEndedIterator`]s.
2609
2606
///
2610
- /// [`DoubleEndedIterator`]: trait.DoubleEndedIterator.html
2611
- ///
2612
2607
/// # Examples
2613
2608
///
2614
2609
/// ```
@@ -2639,7 +2634,7 @@ pub trait Iterator {
2639
2634
///
2640
2635
/// This function is, in some sense, the opposite of [`zip`].
2641
2636
///
2642
- /// [`zip`]: #method. zip
2637
+ /// [`zip`]: Iterator:: zip
2643
2638
///
2644
2639
/// # Examples
2645
2640
///
@@ -2718,7 +2713,7 @@ pub trait Iterator {
2718
2713
/// This is useful when you have an iterator over `&T`, but you need an
2719
2714
/// iterator over `T`.
2720
2715
///
2721
- /// [`clone`]: crate::clone:: Clone::clone
2716
+ /// [`clone`]: Clone::clone
2722
2717
///
2723
2718
/// # Examples
2724
2719
///
@@ -3206,7 +3201,7 @@ pub trait Iterator {
3206
3201
/// assert!(![0.0, 1.0, f32::NAN].iter().is_sorted_by(|a, b| a.partial_cmp(b)));
3207
3202
/// ```
3208
3203
///
3209
- /// [`is_sorted`]: #method. is_sorted
3204
+ /// [`is_sorted`]: Iterator:: is_sorted
3210
3205
#[ unstable( feature = "is_sorted" , reason = "new API" , issue = "53485" ) ]
3211
3206
fn is_sorted_by < F > ( mut self , mut compare : F ) -> bool
3212
3207
where
@@ -3235,7 +3230,7 @@ pub trait Iterator {
3235
3230
/// the elements, as determined by `f`. Apart from that, it's equivalent to [`is_sorted`]; see
3236
3231
/// its documentation for more information.
3237
3232
///
3238
- /// [`is_sorted`]: #method. is_sorted
3233
+ /// [`is_sorted`]: Iterator:: is_sorted
3239
3234
///
3240
3235
/// # Examples
3241
3236
///
0 commit comments