Skip to content

Commit

Permalink
Fix docs test
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Jan 30, 2021
1 parent 5951055 commit 7fb280a
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,6 @@ pub trait Iterator {
/// let a = [1, 2, 3];
///
/// assert!(a.iter().at_least(1, |&x| x > 0));
///
/// assert!(!a.iter().at_least(1, |&x| x > 5));
/// ```
///
Expand All @@ -2300,12 +2299,10 @@ pub trait Iterator {
///
/// let a = vec![1, 2, 3, 4, 5];
///
/// let mut iter = a.iter();
///
/// assert!(iter.at_least(0, |&x| x % 2 == 0));
/// assert!(iter.at_least(1, |&x| x % 2 == 0));
/// assert!(iter.at_least(2, |&x| x % 2 == 0));
/// assert!(!iter.at_least(3, |&x| x % 2 == 0));
/// assert!(a.iter().at_least(0, |&x| x % 2 == 0));
/// assert!(a.iter().at_least(1, |&x| x % 2 == 0));
/// assert!(a.iter().at_least(2, |&x| x % 2 == 0));
/// assert!(!a.iter().at_least(3, |&x| x % 2 == 0));
///
/// // we can still use `iter`, as there are more elements.
/// let a = [1, 2, 3];
Expand Down Expand Up @@ -2358,7 +2355,6 @@ pub trait Iterator {
/// let a = [1, 2, 3];
///
/// assert!(a.iter().at_most(1, |&x| x > 3));
///
/// assert!(!a.iter().at_most(1, |&x| x > 0));
/// ```
///
Expand All @@ -2369,12 +2365,10 @@ pub trait Iterator {
///
/// let a = vec![1, 2, 3, 4, 5];
///
/// let mut iter = a.iter();
///
/// assert!(iter.at_least(0, |&x| x % 2 == 0));
/// assert!(iter.at_least(1, |&x| x % 2 == 0));
/// assert!(iter.at_least(2, |&x| x % 2 == 0));
/// assert!(!iter.at_least(3, |&x| x % 2 == 0));
/// assert!(!a.iter().at_most(0, |&x| x % 2 == 0));
/// assert!(!a.iter().at_most(1, |&x| x % 2 == 0));
/// assert!(a.iter().at_most(2, |&x| x % 2 == 0));
/// assert!(a.iter().at_most(3, |&x| x % 2 == 0));
///
/// // we can still use `iter`, as there are more elements.
/// let a = [1, 1, 3];
Expand Down

0 comments on commit 7fb280a

Please sign in to comment.