Skip to content

Commit ed55a5f

Browse files
Merge #580
580: Deprecate `fold1` in faviour of `reduce` r=jswrenn a=WaffleLapkin [`Iterator::reduce`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.reduce) is stable since Rust 1.51 (current stable is 1.55), so this change seems reasonable (similarly to depreciation of `foreach`) Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
2 parents b6c99ba + 42033ad commit ed55a5f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,7 @@ pub trait Itertools : Iterator {
22432243
/// assert_eq!((0..10).fold1(|x, y| x + y).unwrap_or(0), 45);
22442244
/// assert_eq!((0..0).fold1(|x, y| x * y), None);
22452245
/// ```
2246+
#[deprecated(since = "0.10.2", note = "Use `Iterator::reduce` instead")]
22462247
fn fold1<F>(mut self, f: F) -> Option<Self::Item>
22472248
where F: FnMut(Self::Item, Self::Item) -> Self::Item,
22482249
Self: Sized,

0 commit comments

Comments
 (0)