Skip to content

Commit bacbac5

Browse files
committed
Intra-doc links
This commit changes all the documentation to use intra-doc links, which were stabilized in rust 1.48. This helps to avoid broken links in crates that depend on this one. fixes #496
1 parent 9958c45 commit bacbac5

28 files changed

+79
-90
lines changed

src/adaptors/coalesce.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<I: Iterator, F: CoalescePredicate<I::Item, T>, T> FusedIterator for Coalesc
8484

8585
/// An iterator adaptor that may join together adjacent elements.
8686
///
87-
/// See [`.coalesce()`](../trait.Itertools.html#method.coalesce) for more information.
87+
/// See [`.coalesce()`](crate::Itertools::coalesce) for more information.
8888
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
8989
pub type Coalesce<I, F> = CoalesceBy<I, F, <I as Iterator>::Item>;
9090

@@ -111,7 +111,7 @@ where
111111

112112
/// An iterator adaptor that removes repeated duplicates, determining equality using a comparison function.
113113
///
114-
/// See [`.dedup_by()`](../trait.Itertools.html#method.dedup_by) or [`.dedup()`](../trait.Itertools.html#method.dedup) for more information.
114+
/// See [`.dedup_by()`](crate::Itertools::dedup_by) or [`.dedup()`](crate::Itertools::dedup) for more information.
115115
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
116116
pub type DedupBy<I, Pred> = CoalesceBy<I, DedupPred2CoalescePred<Pred>, <I as Iterator>::Item>;
117117

@@ -165,7 +165,7 @@ where
165165

166166
/// An iterator adaptor that removes repeated duplicates.
167167
///
168-
/// See [`.dedup()`](../trait.Itertools.html#method.dedup) for more information.
168+
/// See [`.dedup()`](crate::Itertools::dedup) for more information.
169169
pub type Dedup<I> = DedupBy<I, DedupEq>;
170170

171171
/// Create a new `Dedup`.
@@ -179,8 +179,8 @@ where
179179
/// An iterator adaptor that removes repeated duplicates, while keeping a count of how many
180180
/// repeated elements were present. This will determine equality using a comparison function.
181181
///
182-
/// See [`.dedup_by_with_count()`](../trait.Itertools.html#method.dedup_by_with_count) or
183-
/// [`.dedup_with_count()`](../trait.Itertools.html#method.dedup_with_count) for more information.
182+
/// See [`.dedup_by_with_count()`](crate::Itertools::dedup_by_with_count) or
183+
/// [`.dedup_with_count()`](crate::Itertools::dedup_with_count) for more information.
184184
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
185185
pub type DedupByWithCount<I, Pred> =
186186
CoalesceBy<I, DedupPredWithCount2CoalescePred<Pred>, (usize, <I as Iterator>::Item)>;
@@ -208,7 +208,7 @@ where
208208
/// An iterator adaptor that removes repeated duplicates, while keeping a count of how many
209209
/// repeated elements were present.
210210
///
211-
/// See [`.dedup_with_count()`](../trait.Itertools.html#method.dedup_with_count) for more information.
211+
/// See [`.dedup_with_count()`](crate::Itertools::dedup_with_count) for more information.
212212
pub type DedupWithCount<I> = DedupByWithCount<I, DedupEq>;
213213

214214
/// Create a new `DedupByWithCount`.

src/adaptors/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ where
6464

6565
/// An iterator adapter to apply a transformation within a nested `Result::Ok`.
6666
///
67-
/// See [`.map_ok()`](../trait.Itertools.html#method.map_ok) for more information.
67+
/// See [`.map_ok()`](crate::Itertools::map_ok) for more information.
6868
pub type MapOk<I, F> = MapSpecialCase<I, MapSpecialCaseFnOk<F>>;
6969

70-
/// See [`MapOk`](struct.MapOk.html).
70+
/// See [`MapOk`].
7171
#[deprecated(note = "Use MapOk instead", since = "0.10.0")]
7272
pub type MapResults<I, F> = MapOk<I, F>;
7373

@@ -98,7 +98,7 @@ where
9898

9999
/// An iterator adapter to apply `Into` conversion to each element.
100100
///
101-
/// See [`.map_into()`](../trait.Itertools.html#method.map_into) for more information.
101+
/// See [`.map_into()`](crate::Itertools::map_into) for more information.
102102
pub type MapInto<I, R> = MapSpecialCase<I, MapSpecialCaseFnInto<R>>;
103103

104104
impl<T: Into<U>, U> MapSpecialCaseFn<T> for MapSpecialCaseFnInto<U> {
@@ -111,7 +111,7 @@ impl<T: Into<U>, U> MapSpecialCaseFn<T> for MapSpecialCaseFnInto<U> {
111111
#[derive(Clone)]
112112
pub struct MapSpecialCaseFnInto<U>(PhantomData<U>);
113113

114-
/// Create a new [`MapInto`](struct.MapInto.html) iterator.
114+
/// Create a new [`MapInto`] iterator.
115115
pub fn map_into<I, R>(iter: I) -> MapInto<I, R> {
116116
MapSpecialCase {
117117
iter,

src/adaptors/mod.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Licensed under the Apache License, Version 2.0
2-
//! http://www.apache.org/licenses/LICENSE-2.0 or the MIT license
3-
//! http://opensource.org/licenses/MIT, at your
2+
//! <http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3+
//! <http://opensource.org/licenses/MIT>, at your
44
//! option. This file may not be copied, modified, or distributed
55
//! except according to those terms.
66
@@ -24,7 +24,7 @@ use crate::size_hint;
2424
///
2525
/// This iterator is *fused*.
2626
///
27-
/// See [`.interleave()`](../trait.Itertools.html#method.interleave) for more information.
27+
/// See [`.interleave()`](crate::Itertools::interleave) for more information.
2828
#[derive(Clone, Debug)]
2929
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
3030
pub struct Interleave<I, J> {
@@ -37,7 +37,7 @@ pub struct Interleave<I, J> {
3737
///
3838
/// `IntoIterator` enabled version of `i.interleave(j)`.
3939
///
40-
/// See [`.interleave()`](trait.Itertools.html#method.interleave) for more information.
40+
/// See [`.interleave()`](crate::Itertools::interleave) for more information.
4141
pub fn interleave<I, J>(i: I, j: J) -> Interleave<<I as IntoIterator>::IntoIter, <J as IntoIterator>::IntoIter>
4242
where I: IntoIterator,
4343
J: IntoIterator<Item = I::Item>
@@ -80,7 +80,7 @@ impl<I, J> Iterator for Interleave<I, J>
8080
///
8181
/// This iterator is *fused*.
8282
///
83-
/// See [`.interleave_shortest()`](../trait.Itertools.html#method.interleave_shortest)
83+
/// See [`.interleave_shortest()`](crate::Itertools::interleave_shortest)
8484
/// for more information.
8585
#[derive(Clone, Debug)]
8686
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
@@ -271,7 +271,7 @@ impl<I> Iterator for PutBack<I>
271271
///
272272
/// Iterator element type is `(I::Item, J::Item)`.
273273
///
274-
/// See [`.cartesian_product()`](../trait.Itertools.html#method.cartesian_product) for more information.
274+
/// See [`.cartesian_product()`](crate::Itertools::cartesian_product) for more information.
275275
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
276276
pub struct Product<I, J>
277277
where I: Iterator
@@ -366,7 +366,7 @@ impl<I, J> Iterator for Product<I, J>
366366
///
367367
/// Iterator element type is *X*, if the return type of `F` is *Option\<X\>*.
368368
///
369-
/// See [`.batching()`](../trait.Itertools.html#method.batching) for more information.
369+
/// See [`.batching()`](crate::Itertools::batching) for more information.
370370
#[derive(Clone)]
371371
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
372372
pub struct Batching<I, F> {
@@ -400,7 +400,7 @@ impl<B, F, I> Iterator for Batching<I, F>
400400
/// The iterator steps by yielding the next element from the base iterator,
401401
/// then skipping forward *n-1* elements.
402402
///
403-
/// See [`.step()`](../trait.Itertools.html#method.step) for more information.
403+
/// See [`.step()`](crate::Itertools::step) for more information.
404404
#[deprecated(note="Use std .step_by() instead", since="0.8.0")]
405405
#[allow(deprecated)]
406406
#[derive(Clone, Debug)]
@@ -475,7 +475,7 @@ impl<T: PartialOrd> MergePredicate<T> for MergeLte {
475475
///
476476
/// Iterator element type is `I::Item`.
477477
///
478-
/// See [`.merge()`](../trait.Itertools.html#method.merge_by) for more information.
478+
/// See [`.merge()`](crate::Itertools::merge_by) for more information.
479479
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
480480
pub type Merge<I, J> = MergeBy<I, J, MergeLte>;
481481

@@ -503,7 +503,7 @@ pub fn merge<I, J>(i: I, j: J) -> Merge<<I as IntoIterator>::IntoIter, <J as Int
503503
///
504504
/// Iterator element type is `I::Item`.
505505
///
506-
/// See [`.merge_by()`](../trait.Itertools.html#method.merge_by) for more information.
506+
/// See [`.merge_by()`](crate::Itertools::merge_by) for more information.
507507
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
508508
pub struct MergeBy<I, J, F>
509509
where I: Iterator,
@@ -591,7 +591,7 @@ impl<I, J, F> Iterator for MergeBy<I, J, F>
591591
/// An iterator adaptor that borrows from a `Clone`-able iterator
592592
/// to only pick off elements while the predicate returns `true`.
593593
///
594-
/// See [`.take_while_ref()`](../trait.Itertools.html#method.take_while_ref) for more information.
594+
/// See [`.take_while_ref()`](crate::Itertools::take_while_ref) for more information.
595595
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
596596
pub struct TakeWhileRef<'a, I: 'a, F> {
597597
iter: &'a mut I,
@@ -640,7 +640,7 @@ impl<'a, I, F> Iterator for TakeWhileRef<'a, I, F>
640640
/// An iterator adaptor that filters `Option<A>` iterator elements
641641
/// and produces `A`. Stops on the first `None` encountered.
642642
///
643-
/// See [`.while_some()`](../trait.Itertools.html#method.while_some) for more information.
643+
/// See [`.while_some()`](crate::Itertools::while_some) for more information.
644644
#[derive(Clone, Debug)]
645645
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
646646
pub struct WhileSome<I> {
@@ -672,7 +672,7 @@ impl<I, A> Iterator for WhileSome<I>
672672
/// An iterator to iterate through all combinations in a `Clone`-able iterator that produces tuples
673673
/// of a specific size.
674674
///
675-
/// See [`.tuple_combinations()`](../trait.Itertools.html#method.tuple_combinations) for more
675+
/// See [`.tuple_combinations()`](crate::Itertools::tuple_combinations) for more
676676
/// information.
677677
#[derive(Clone, Debug)]
678678
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
@@ -822,7 +822,7 @@ impl_tuple_combination!(Tuple12Combination Tuple11Combination; A, A, A, A, A, A,
822822

823823
/// An iterator adapter to filter values within a nested `Result::Ok`.
824824
///
825-
/// See [`.filter_ok()`](../trait.Itertools.html#method.filter_ok) for more information.
825+
/// See [`.filter_ok()`](crate::Itertools::filter_ok) for more information.
826826
#[derive(Clone)]
827827
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
828828
pub struct FilterOk<I, F> {
@@ -886,7 +886,7 @@ impl<I, F, T, E> Iterator for FilterOk<I, F>
886886

887887
/// An iterator adapter to filter and apply a transformation on values within a nested `Result::Ok`.
888888
///
889-
/// See [`.filter_map_ok()`](../trait.Itertools.html#method.filter_map_ok) for more information.
889+
/// See [`.filter_map_ok()`](crate::Itertools::filter_map_ok) for more information.
890890
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
891891
pub struct FilterMapOk<I, F> {
892892
iter: I,
@@ -957,7 +957,7 @@ impl<I, F, T, U, E> Iterator for FilterMapOk<I, F>
957957

958958
/// An iterator adapter to get the positions of each element that matches a predicate.
959959
///
960-
/// See [`.positions()`](../trait.Itertools.html#method.positions) for more information.
960+
/// See [`.positions()`](crate::Itertools::positions) for more information.
961961
#[derive(Clone)]
962962
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
963963
pub struct Positions<I, F> {
@@ -1016,7 +1016,7 @@ impl<I, F> DoubleEndedIterator for Positions<I, F>
10161016

10171017
/// An iterator adapter to apply a mutating function to each element before yielding it.
10181018
///
1019-
/// See [`.update()`](../trait.Itertools.html#method.update) for more information.
1019+
/// See [`.update()`](crate::Itertools::update) for more information.
10201020
#[derive(Clone)]
10211021
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
10221022
pub struct Update<I, F> {

src/adaptors/multi_product.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use alloc::vec::Vec;
1111
///
1212
/// An iterator element type is `Vec<I>`.
1313
///
14-
/// See [`.multi_cartesian_product()`](../trait.Itertools.html#method.multi_cartesian_product)
14+
/// See [`.multi_cartesian_product()`](crate::Itertools::multi_cartesian_product)
1515
/// for more information.
1616
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
1717
pub struct MultiProduct<I>(Vec<MultiProductIter<I>>)

src/combinations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use alloc::vec::Vec;
55

66
/// An iterator to iterate through all the `k`-length combinations in an iterator.
77
///
8-
/// See [`.combinations()`](../trait.Itertools.html#method.combinations) for more information.
8+
/// See [`.combinations()`](crate::Itertools::combinations) for more information.
99
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
1010
pub struct Combinations<I: Iterator> {
1111
indices: Vec<usize>,

src/combinations_with_replacement.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use super::lazy_buffer::LazyBuffer;
55

66
/// An iterator to iterate through all the `n`-length combinations in an iterator, with replacement.
77
///
8-
/// See [`.combinations_with_replacement()`](../trait.Itertools.html#method.combinations_with_replacement) for more information.
8+
/// See [`.combinations_with_replacement()`](crate::Itertools::combinations_with_replacement)
9+
/// for more information.
910
#[derive(Clone)]
1011
pub struct CombinationsWithReplacement<I>
1112
where

src/diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//! "Diff"ing iterators for caching elements to sequential collections without requiring the new
22
//! elements' iterator to be `Clone`.
33
//!
4-
//! - [**Diff**](./enum.Diff.html) (produced by the [**diff_with**](./fn.diff_with.html) function)
4+
//! - [`Diff`] (produced by the [`diff_with`] function)
55
//! describes the difference between two non-`Clone` iterators `I` and `J` after breaking ASAP from
66
//! a lock-step comparison.
77
88
use crate::free::put_back;
99
use crate::structs::PutBack;
1010

11-
/// A type returned by the [`diff_with`](./fn.diff_with.html) function.
11+
/// A type returned by the [`diff_with`] function.
1212
///
1313
/// `Diff` represents the way in which the elements yielded by the iterator `I` differ to some
1414
/// iterator `J`.

src/either_or_both.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<A, B> EitherOrBoth<A, B> {
2525
}
2626

2727
/// If Left, return true otherwise, return false.
28-
/// Exclusive version of [`has_left`].
28+
/// Exclusive version of [`has_left`](Self::has_left).
2929
pub fn is_left(&self) -> bool {
3030
match *self {
3131
Left(_) => true,
@@ -34,7 +34,7 @@ impl<A, B> EitherOrBoth<A, B> {
3434
}
3535

3636
/// If Right, return true otherwise, return false.
37-
/// Exclusive version of [`has_right`].
37+
/// Exclusive version of [`has_right`](Self::has_right).
3838
pub fn is_right(&self) -> bool {
3939
match *self {
4040
Right(_) => true,

src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::cell::RefCell;
66
/// The format value can only be formatted once, after that the iterator is
77
/// exhausted.
88
///
9-
/// See [`.format_with()`](../trait.Itertools.html#method.format_with) for more information.
9+
/// See [`.format_with()`](crate::Itertools::format_with) for more information.
1010
#[derive(Clone)]
1111
pub struct FormatWith<'a, I, F> {
1212
sep: &'a str,
@@ -19,7 +19,7 @@ pub struct FormatWith<'a, I, F> {
1919
/// The format value can only be formatted once, after that the iterator is
2020
/// exhausted.
2121
///
22-
/// See [`.format()`](../trait.Itertools.html#method.format)
22+
/// See [`.format()`](crate::Itertools::format)
2323
/// for more information.
2424
#[derive(Clone)]
2525
pub struct Format<'a, I> {

src/free.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub fn join<I>(iterable: I, sep: &str) -> String
225225
///
226226
/// `IntoIterator` enabled version of [`iterable.sorted()`][1].
227227
///
228-
/// [1]: trait.Itertools.html#method.sorted
228+
/// [1]: crate::Itertools::sorted
229229
///
230230
/// ```
231231
/// use itertools::sorted;

src/group_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::iter::Iterator;
66

77
/// Return a `HashMap` of keys mapped to a list of their corresponding values.
88
///
9-
/// See [`.into_group_map()`](../trait.Itertools.html#method.into_group_map)
9+
/// See [`.into_group_map()`](crate::Itertools::into_group_map)
1010
/// for more information.
1111
pub fn into_group_map<I, K, V>(iter: I) -> HashMap<K, Vec<V>>
1212
where I: Iterator<Item=(K, V)>,

src/groupbylazy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ impl<K, I, F> GroupInner<K, I, F>
284284
/// value. It should be stored in a local variable or temporary and
285285
/// iterated.
286286
///
287-
/// See [`.group_by()`](../trait.Itertools.html#method.group_by) for more information.
287+
/// See [`.group_by()`](crate::Itertools::group_by) for more information.
288288
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
289289
pub struct GroupBy<K, I, F>
290290
where I: Iterator,
@@ -354,7 +354,7 @@ impl<'a, K, I, F> IntoIterator for &'a GroupBy<K, I, F>
354354
/// Iterator element type is `(K, Group)`:
355355
/// the group's key `K` and the group's iterator.
356356
///
357-
/// See [`.group_by()`](../trait.Itertools.html#method.group_by) for more information.
357+
/// See [`.group_by()`](crate::Itertools::group_by) for more information.
358358
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
359359
pub struct Groups<'a, K: 'a, I: 'a, F: 'a>
360360
where I: Iterator,
@@ -460,7 +460,7 @@ pub fn new_chunks<J>(iter: J, size: usize) -> IntoChunks<J::IntoIter>
460460
///
461461
/// Iterator element type is `Chunk`, each chunk's iterator.
462462
///
463-
/// See [`.chunks()`](../trait.Itertools.html#method.chunks) for more information.
463+
/// See [`.chunks()`](crate::Itertools::chunks) for more information.
464464
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
465465
pub struct IntoChunks<I>
466466
where I: Iterator,
@@ -505,7 +505,7 @@ impl<'a, I> IntoIterator for &'a IntoChunks<I>
505505
///
506506
/// Iterator element type is `Chunk`.
507507
///
508-
/// See [`.chunks()`](../trait.Itertools.html#method.chunks) for more information.
508+
/// See [`.chunks()`](crate::Itertools::chunks) for more information.
509509
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
510510
pub struct Chunks<'a, I: 'a>
511511
where I: Iterator,

src/intersperse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<Item: Clone> IntersperseElement<Item> for IntersperseElementSimple<Item> {
2121
///
2222
/// This iterator is *fused*.
2323
///
24-
/// See [`.intersperse()`](../trait.Itertools.html#method.intersperse) for more information.
24+
/// See [`.intersperse()`](crate::Itertools::intersperse) for more information.
2525
pub type Intersperse<I> = IntersperseWith<I, IntersperseElementSimple<<I as Iterator>::Item>>;
2626

2727
/// Create a new Intersperse iterator
@@ -44,7 +44,7 @@ impl<Item, F: FnMut()->Item> IntersperseElement<Item> for F {
4444
///
4545
/// This iterator is *fused*.
4646
///
47-
/// See [`.intersperse_with()`](../trait.Itertools.html#method.intersperse_with) for more information.
47+
/// See [`.intersperse_with()`](crate::Itertools::intersperse_with) for more information.
4848
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
4949
#[derive(Clone, Debug)]
5050
pub struct IntersperseWith<I, ElemF>

src/kmerge_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn sift_down<T, S>(heap: &mut [T], index: usize, mut less_than: S)
9898
///
9999
/// Iterator element type is `I::Item`.
100100
///
101-
/// See [`.kmerge()`](../trait.Itertools.html#method.kmerge) for more information.
101+
/// See [`.kmerge()`](crate::Itertools::kmerge) for more information.
102102
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
103103
pub type KMerge<I> = KMergeBy<I, KMergeByLt>;
104104

@@ -146,7 +146,7 @@ pub fn kmerge<I>(iterable: I) -> KMerge<<I::Item as IntoIterator>::IntoIter>
146146
///
147147
/// Iterator element type is `I::Item`.
148148
///
149-
/// See [`.kmerge_by()`](../trait.Itertools.html#method.kmerge_by) for more
149+
/// See [`.kmerge_by()`](crate::Itertools::kmerge_by) for more
150150
/// information.
151151
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
152152
pub struct KMergeBy<I, F>

0 commit comments

Comments
 (0)