Skip to content

Commit b5c1242

Browse files
committed
Add more tests to doc test
1 parent 7bd13fc commit b5c1242

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,8 @@ pub trait Itertools : Iterator {
17391739
///
17401740
/// let numbers = [1, 2, 3, 4];
17411741
/// assert_eq!(numbers.iter().find_or_last(|&&x| x > 5), Some(&4));
1742+
/// assert_eq!(numbers.iter().find_or_last(|&&x| x > 2), Some(&3));
1743+
/// assert_eq!(std::iter::empty::<i32>().find_or_last(|&x| x > 5), None);
17421744
/// ```
17431745
fn find_or_last<P>(mut self, predicate: P) -> Option<Self::Item>
17441746
where Self: Sized,

0 commit comments

Comments
 (0)