Skip to content

Commit 926cfb7

Browse files
author
root
committed
docs: Remove section text for examples
The heading `Example` is distracting. I think we present the docs just as well without it. See issue rust-lang/rust#17193
1 parent 7b218fd commit 926cfb7

File tree

8 files changed

+0
-73
lines changed

8 files changed

+0
-73
lines changed

src/adaptors.rs

-2
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ impl<I: Iterator> PutBackN<I>
198198
/// Puts x in front of the iterator.
199199
/// The values are yielded in order.
200200
///
201-
/// ## Example
202-
///
203201
/// ```rust
204202
/// use itertools::PutBackN;
205203
///

src/islice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use super::misc::GenericRange;
77
/// **Note:** slicing an iterator is not constant time, and much less efficient than
88
/// slicing for example a vector.
99
///
10-
/// ## Example
1110
/// ```
1211
/// use std::iter::repeat;
1312
/// use itertools::Itertools;

src/lib.rs

-58
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ pub type MergeAscend<I, J> where I: Iterator = Merge<I, J, fn(&I::Item, &I::Item
100100
/// Iterator element type is like **(A, B, ..., E)** if formed
101101
/// from iterators **(I, J, ..., M)** with element types **I::Item = A**, **J::Item = B**, etc.
102102
///
103-
/// ## Example
104-
///
105103
/// ```
106104
/// #[macro_use]
107105
/// extern crate itertools;
@@ -141,8 +139,6 @@ macro_rules! iproduct {
141139
/// from iterators `(I, J, ..., M)` implementing `I: Iterator<A>`,
142140
/// `J: Iterator<B>`, ..., `M: Iterator<E>`
143141
///
144-
/// ## Example
145-
///
146142
/// ```
147143
/// #[macro_use]
148144
/// extern crate itertools;
@@ -194,8 +190,6 @@ macro_rules! izip {
194190
///
195191
/// Iterator element type is the type of `<expression>`
196192
///
197-
/// ## Example
198-
///
199193
/// ```ignore
200194
/// let mut squares = icompr!(x * x, x, 1..100);
201195
/// ```
@@ -230,8 +224,6 @@ pub trait Itertools : Iterator {
230224
///
231225
/// This iterator is *fused*.
232226
///
233-
/// ## Example
234-
///
235227
/// ```
236228
/// use itertools::Itertools;
237229
///
@@ -252,8 +244,6 @@ pub trait Itertools : Iterator {
252244
///
253245
/// This iterator is *fused*.
254246
///
255-
/// ## Example
256-
///
257247
/// ```
258248
/// use itertools::Itertools;
259249
///
@@ -274,8 +264,6 @@ pub trait Itertools : Iterator {
274264
/// When both iterators return **None**, all further invocations of *.next()*
275265
/// will return **None**.
276266
///
277-
/// # Example
278-
///
279267
/// ```rust
280268
/// use itertools::EitherOrBoth::{Both, Right};
281269
/// use itertools::Itertools;
@@ -297,8 +285,6 @@ pub trait Itertools : Iterator {
297285
///
298286
/// Iterator element type is **B**.
299287
///
300-
/// ## Example
301-
///
302288
/// ```
303289
/// use itertools::Itertools;
304290
///
@@ -328,8 +314,6 @@ pub trait Itertools : Iterator {
328314
///
329315
/// Iterator element type is **(K, Vec\<Self::Item\>)**
330316
///
331-
/// ## Example
332-
///
333317
/// ```
334318
/// use itertools::Itertools;
335319
///
@@ -354,7 +338,6 @@ pub trait Itertools : Iterator {
354338
///
355339
/// Iterator element type is **Self::Item**.
356340
///
357-
/// ## Example
358341
/// ```
359342
/// use itertools::Itertools;
360343
/// let xs = vec![0, 1, 2, 3];
@@ -382,7 +365,6 @@ pub trait Itertools : Iterator {
382365
///
383366
/// Iterator element type is **Self::Item**.
384367
///
385-
/// ## Example
386368
/// ```
387369
/// use std::iter::repeat;
388370
/// use itertools::Itertools;
@@ -408,8 +390,6 @@ pub trait Itertools : Iterator {
408390
///
409391
/// Iterator element type is **Self::Item**.
410392
///
411-
/// ## Example
412-
///
413393
/// ```
414394
/// use itertools::Itertools;
415395
///
@@ -442,7 +422,6 @@ pub trait Itertools : Iterator {
442422
///
443423
/// **Panics** if the step is 0.
444424
///
445-
/// ## Example
446425
/// ```
447426
/// use itertools::Itertools;
448427
///
@@ -460,7 +439,6 @@ pub trait Itertools : Iterator {
460439
///
461440
/// Iterator element type is **Self::Item**.
462441
///
463-
/// ## Example
464442
/// ```
465443
/// use itertools::Itertools;
466444
///
@@ -487,7 +465,6 @@ pub trait Itertools : Iterator {
487465
///
488466
/// Iterator element type is **Self::Item**.
489467
///
490-
/// ## Example
491468
/// ```
492469
/// use itertools::Itertools;
493470
///
@@ -549,8 +526,6 @@ pub trait Itertools : Iterator {
549526
///
550527
/// After a call to *.next()* the peeking cursor is reset.
551528
///
552-
/// ## Example
553-
///
554529
/// ```
555530
/// use itertools::Itertools;
556531
///
@@ -580,8 +555,6 @@ pub trait Itertools : Iterator {
580555
///
581556
/// This iterator is *fused*.
582557
///
583-
/// ## Example
584-
///
585558
/// ```
586559
/// use itertools::Itertools;
587560
///
@@ -609,8 +582,6 @@ pub trait Itertools : Iterator {
609582
///
610583
/// This iterator is *fused*.
611584
///
612-
/// ## Example
613-
///
614585
/// ```
615586
/// use itertools::Itertools;
616587
///
@@ -635,8 +606,6 @@ pub trait Itertools : Iterator {
635606
/// Only implemented for iterators with slice or string slice elements.
636607
/// Only slices that are contiguous together can be joined.
637608
///
638-
/// ## Example
639-
///
640609
/// ```
641610
/// use itertools::Itertools;
642611
///
@@ -663,8 +632,6 @@ pub trait Itertools : Iterator {
663632
/// It uses the **Clone** trait to restore the original iterator so that the last
664633
/// and rejected element is still available when **TakeWhileRef** is done.
665634
///
666-
/// ## Example
667-
///
668635
/// ```
669636
/// use itertools::Itertools;
670637
///
@@ -705,8 +672,6 @@ pub trait Itertools : Iterator {
705672
///
706673
/// Iterator element type is **B**.
707674
///
708-
/// ## Example
709-
///
710675
/// ```
711676
/// use itertools::Itertools;
712677
///
@@ -738,8 +703,6 @@ pub trait Itertools : Iterator {
738703
///
739704
/// The iterator is not advanced past the first element found.
740705
///
741-
/// ## Example
742-
///
743706
/// ```
744707
/// use itertools::Itertools;
745708
///
@@ -764,8 +727,6 @@ pub trait Itertools : Iterator {
764727
///
765728
/// Return actual number of elements consumed, until done or reaching the end.
766729
///
767-
/// ## Example
768-
///
769730
/// ```
770731
/// use itertools::Itertools;
771732
///
@@ -793,8 +754,6 @@ pub trait Itertools : Iterator {
793754
/// It works similarly to **.skip(n)** except it is eager and
794755
/// preserves the iterator type.
795756
///
796-
/// ## Example
797-
///
798757
/// ```
799758
/// use itertools::Itertools;
800759
///
@@ -817,8 +776,6 @@ pub trait Itertools : Iterator {
817776
/// Note: This method is eager, dropping the back elements immediately and
818777
/// preserves the iterator type.
819778
///
820-
/// ## Example
821-
///
822779
/// ```
823780
/// use itertools::Itertools;
824781
///
@@ -837,8 +794,6 @@ pub trait Itertools : Iterator {
837794
///
838795
/// Consumes the iterator until its end.
839796
///
840-
/// ## Example
841-
///
842797
/// ```
843798
/// use std::sync::mpsc::channel;
844799
/// use itertools::Itertools;
@@ -874,7 +829,6 @@ pub trait Itertools : Iterator {
874829
///
875830
/// Return the number of elements written.
876831
///
877-
/// ## Example
878832
/// ```
879833
/// use itertools::Itertools;
880834
///
@@ -902,8 +856,6 @@ pub trait Itertools : Iterator {
902856
///
903857
/// Use the **Display** implementation of each element.
904858
///
905-
/// ## Example
906-
///
907859
/// ```
908860
/// use itertools::Itertools;
909861
///
@@ -953,8 +905,6 @@ pub trait Itertools : Iterator {
953905
/// With a **start** value of 0 and an addition as folding function,
954906
/// this effetively results in *((0 + 1) + 2) + 3*
955907
///
956-
/// ## Example
957-
///
958908
/// ```
959909
/// use std::ops::Add;
960910
/// use itertools::Itertools;
@@ -992,8 +942,6 @@ pub trait Itertools : Iterator {
992942
/// empty, return **None**. With just one element, return it.
993943
/// Otherwise elements are accumulated in sequence using the closure **f**.
994944
///
995-
/// ## Example
996-
///
997945
/// ```
998946
/// use itertools::Itertools;
999947
///
@@ -1018,8 +966,6 @@ pub trait Itertools : Iterator {
1018966
/// Return **None** if the size hint does not tell, or return a **Some**
1019967
/// value with the emptiness if it's possible to tell.
1020968
///
1021-
/// ## Example
1022-
///
1023969
/// ```
1024970
/// use itertools::Itertools;
1025971
///
@@ -1051,8 +997,6 @@ impl<T: ?Sized> Itertools for T where T: Iterator { }
1051997
/// (elements pairwise equal and sequences of the same length),
1052998
/// **false** otherwise.
1053999
///
1054-
/// ## Example
1055-
///
10561000
/// ```
10571001
/// assert!(itertools::equal(vec![1, 2, 3], 1..4));
10581002
/// assert!(!itertools::equal(&[0, 0], &[0, 0, 0]));
@@ -1080,8 +1024,6 @@ pub fn equal<I, J>(a: I, b: J) -> bool where
10801024
///
10811025
/// Return the index of the split point.
10821026
///
1083-
/// ## Example
1084-
///
10851027
/// ```
10861028
/// use itertools::partition;
10871029
///

src/size_hint.rs

-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ pub fn sub_scalar(sh: SizeHint, x: usize) -> SizeHint
4343

4444
/// Multiply **x** correctly with a **SizeHint**.
4545
///
46-
/// # Examples
47-
///
4846
/// ```
4947
/// use std::usize;
5048
/// use itertools::size_hint;
@@ -69,8 +67,6 @@ pub fn mul_scalar(sh: SizeHint, x: usize) -> SizeHint
6967

7068
/// Multiply **SizeHint** correctly
7169
///
72-
/// # Examples
73-
///
7470
/// ```
7571
/// use std::usize;
7672
/// use itertools::size_hint;

src/sources.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
///
77
/// Iterator element type is the return type of the closure.
88
///
9-
/// ## Example
10-
///
119
/// ```
1210
/// use itertools::RepeatCall;
1311
///

src/stride.rs

-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ macro_rules! stride_impl {
8989
///
9090
/// If `step` is negative, start from the back.
9191
///
92-
/// ## Example
93-
///
9492
/// ```
9593
/// use itertools::Stride;
9694
///

src/ziptrusted.rs

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ unsafe impl<I> TrustedIterator for iter::Take<I> where
4444
/// Iterator element type is like **(A, B, ..., E)** where **A** to **E** are the respective
4545
/// subiterator types.
4646
///
47-
/// ## Example
48-
///
4947
/// ```
5048
/// use itertools::ZipTrusted;
5149
///

src/ziptuple.rs

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use super::size_hint;
1111
/// The iterator element type is a tuple like like **(A, B, ..., E)** where **A** to **E** are the
1212
/// element types of the subiterator.
1313
///
14-
/// ## Example
15-
///
1614
/// ```
1715
/// use itertools::Zip;
1816
///

0 commit comments

Comments
 (0)