Skip to content

Commit ba7d4e2

Browse files
committed
Add missing links
1 parent 0366c2d commit ba7d4e2

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/lib.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ pub trait Itertools : Iterator {
948948
}
949949

950950
/// Return an iterator adaptor that merges the two base iterators in order.
951-
/// This is much like `.merge()` but allows for a custom ordering.
951+
/// This is much like [`.merge()`](Itertools::merge) but allows for a custom ordering.
952952
///
953953
/// This can be especially useful for sequences of tuples.
954954
///
@@ -1935,7 +1935,7 @@ pub trait Itertools : Iterator {
19351935
concat(self)
19361936
}
19371937

1938-
/// `.collect_vec()` is simply a type specialization of `.collect()`,
1938+
/// `.collect_vec()` is simply a type specialization of [`Iterator::collect`],
19391939
/// for convenience.
19401940
#[cfg(feature = "use_alloc")]
19411941
fn collect_vec(self) -> Vec<Self::Item>
@@ -2057,7 +2057,7 @@ pub trait Itertools : Iterator {
20572057

20582058
/// Format all iterator elements, separated by `sep`.
20592059
///
2060-
/// This is a customizable version of `.format()`.
2060+
/// This is a customizable version of [`.format()`](Itertools::format).
20612061
///
20622062
/// The supplied closure `format` is called once per iterator element,
20632063
/// with two arguments: the element and a callback that takes a
@@ -2164,7 +2164,7 @@ pub trait Itertools : Iterator {
21642164
/// value is returned inside `Some`. Otherwise, the operation terminates
21652165
/// and returns `None`. No iterator elements are consumed after the `None`.
21662166
///
2167-
/// This is the `Option` equivalent to `fold_ok`.
2167+
/// This is the `Option` equivalent to [`fold_ok`](Itertools::fold_ok).
21682168
///
21692169
/// ```
21702170
/// use std::ops::Add;
@@ -2318,7 +2318,7 @@ pub trait Itertools : Iterator {
23182318

23192319
/// An iterator method that applies a function, producing a single, final value.
23202320
///
2321-
/// `fold_while()` is basically equivalent to `fold()` but with additional support for
2321+
/// `fold_while()` is basically equivalent to [`Iterator::fold`] but with additional support for
23222322
/// early exit via short-circuiting.
23232323
///
23242324
/// ```
@@ -2437,7 +2437,7 @@ pub trait Itertools : Iterator {
24372437
/// Sort all iterator elements into a new iterator in ascending order.
24382438
///
24392439
/// **Note:** This consumes the entire iterator, uses the
2440-
/// `slice::sort_unstable()` method and returns the result as a new
2440+
/// [`slice::sort_unstable`] method and returns the result as a new
24412441
/// iterator that owns its elements.
24422442
///
24432443
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2466,7 +2466,7 @@ pub trait Itertools : Iterator {
24662466
/// Sort all iterator elements into a new iterator in ascending order.
24672467
///
24682468
/// **Note:** This consumes the entire iterator, uses the
2469-
/// `slice::sort_unstable_by()` method and returns the result as a new
2469+
/// [`slice::sort_unstable_by`] method and returns the result as a new
24702470
/// iterator that owns its elements.
24712471
///
24722472
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2499,7 +2499,7 @@ pub trait Itertools : Iterator {
24992499
/// Sort all iterator elements into a new iterator in ascending order.
25002500
///
25012501
/// **Note:** This consumes the entire iterator, uses the
2502-
/// `slice::sort_unstable_by_key()` method and returns the result as a new
2502+
/// [`slice::sort_unstable_by_key`] method and returns the result as a new
25032503
/// iterator that owns its elements.
25042504
///
25052505
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2533,7 +2533,7 @@ pub trait Itertools : Iterator {
25332533
/// Sort all iterator elements into a new iterator in ascending order.
25342534
///
25352535
/// **Note:** This consumes the entire iterator, uses the
2536-
/// `slice::sort()` method and returns the result as a new
2536+
/// [`slice::sort`] method and returns the result as a new
25372537
/// iterator that owns its elements.
25382538
///
25392539
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2562,7 +2562,7 @@ pub trait Itertools : Iterator {
25622562
/// Sort all iterator elements into a new iterator in ascending order.
25632563
///
25642564
/// **Note:** This consumes the entire iterator, uses the
2565-
/// `slice::sort_by()` method and returns the result as a new
2565+
/// [`slice::sort_by`] method and returns the result as a new
25662566
/// iterator that owns its elements.
25672567
///
25682568
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2595,7 +2595,7 @@ pub trait Itertools : Iterator {
25952595
/// Sort all iterator elements into a new iterator in ascending order.
25962596
///
25972597
/// **Note:** This consumes the entire iterator, uses the
2598-
/// `slice::sort_by_key()` method and returns the result as a new
2598+
/// [`slice::sort_by_key`] method and returns the result as a new
25992599
/// iterator that owns its elements.
26002600
///
26012601
/// The sorted iterator, if directly collected to a `Vec`, is converted
@@ -2664,7 +2664,7 @@ pub trait Itertools : Iterator {
26642664
}
26652665

26662666
/// Collect all iterator elements into one of two
2667-
/// partitions. Unlike `Iterator::partition`, each partition may
2667+
/// partitions. Unlike [`Iterator::partition`], each partition may
26682668
/// have a distinct type.
26692669
///
26702670
/// ```
@@ -2865,11 +2865,11 @@ pub trait Itertools : Iterator {
28652865
/// Return the minimum and maximum element of an iterator, as determined by
28662866
/// the specified function.
28672867
///
2868-
/// The return value is a variant of [`MinMaxResult`] like for `minmax()`.
2868+
/// The return value is a variant of [`MinMaxResult`] like for [`.minmax()`](Itertools::minmax).
28692869
///
28702870
/// For the minimum, the first minimal element is returned. For the maximum,
28712871
/// the last maximal element wins. This matches the behavior of the standard
2872-
/// `Iterator::min()` and `Iterator::max()` methods.
2872+
/// [`Iterator::min`] and [`Iterator::max`] methods.
28732873
///
28742874
/// The keys can be floats but no particular result is guaranteed
28752875
/// if a key is NaN.
@@ -2882,11 +2882,11 @@ pub trait Itertools : Iterator {
28822882
/// Return the minimum and maximum element of an iterator, as determined by
28832883
/// the specified comparison function.
28842884
///
2885-
/// The return value is a variant of [`MinMaxResult`] like for `minmax()`.
2885+
/// The return value is a variant of [`MinMaxResult`] like for [`.minmax()`](Itertools::minmax).
28862886
///
28872887
/// For the minimum, the first minimal element is returned. For the maximum,
28882888
/// the last maximal element wins. This matches the behavior of the standard
2889-
/// `Iterator::min()` and `Iterator::max()` methods.
2889+
/// [`Iterator::min`] and [`Iterator::max`] methods.
28902890
fn minmax_by<F>(self, mut compare: F) -> MinMaxResult<Self::Item>
28912891
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering
28922892
{

src/minmax.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
/// `MinMaxResult` is an enum returned by `minmax`. See `Itertools::minmax()` for
3-
/// more detail.
2+
/// `MinMaxResult` is an enum returned by `minmax`.
3+
///
4+
/// See [`.minmax()`](crate::Itertools::minmax) for more detail.
45
#[derive(Copy, Clone, PartialEq, Debug)]
56
pub enum MinMaxResult<T> {
67
/// Empty iterator

0 commit comments

Comments
 (0)