Skip to content

Commit 2541ca9

Browse files
committed
Make the doctests pass
1 parent eb967a1 commit 2541ca9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,18 +1618,20 @@ pub trait Itertools : Iterator {
16181618
/// iterator will be exhausted.
16191619
///
16201620
/// ```
1621+
/// use itertools::Itertools;
1622+
///
16211623
/// #[derive(PartialEq, Debug)]
16221624
/// enum Enum { A, B, C, D, E, }
16231625
///
16241626
/// let mut iter = vec![Enum::A, Enum::B, Enum::C, Enum::D].into_iter();
16251627
///
16261628
/// // search `iter` for `B`
1627-
/// assert_eq!(iter.contains(Enum::B), true);
1629+
/// assert_eq!(iter.contains(&Enum::B), true);
16281630
/// // `B` was found, so the iterator now rests at the item after `B` (i.e, `C`).
16291631
/// assert_eq!(iter.next(), Some(Enum::C));
16301632
///
16311633
/// // search `iter` for `E`
1632-
/// assert_eq!(iter.contains(Enum::E), false);
1634+
/// assert_eq!(iter.contains(&Enum::E), false);
16331635
/// // `E` wasn't found, so `iter` is now exhausted
16341636
/// assert_eq!(iter.next(), None);
16351637
/// ```

0 commit comments

Comments
 (0)