Skip to content

Commit 0bfd61b

Browse files
committed
API: Deprecate .fold_while() in favour of .try_fold()
1 parent 3ca656c commit 0bfd61b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,7 @@ pub trait Itertools : Iterator {
17671767
/// The big difference between the computations of `result2` and `result3` is that while
17681768
/// `fold()` called the provided closure for every item of the callee iterator,
17691769
/// `fold_while()` actually stopped iterating as soon as it encountered `Fold::Done(_)`.
1770+
#[deprecated(note="Use .try_fold() instead", since="0.8")]
17701771
fn fold_while<B, F>(&mut self, init: B, mut f: F) -> FoldWhile<B>
17711772
where Self: Sized,
17721773
F: FnMut(B, Self::Item) -> FoldWhile<B>

tests/test_std.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ fn while_some() {
702702
it::assert_equal(ns, vec![1, 2, 3, 4]);
703703
}
704704

705+
#[allow(deprecated)]
705706
#[test]
706707
fn fold_while() {
707708
let mut iterations = 0;

0 commit comments

Comments
 (0)