Skip to content

Commit

Permalink
allow usage of fold1
Browse files Browse the repository at this point in the history
  • Loading branch information
hellow554 authored and phimuemue committed Jun 3, 2022
1 parent ba098ad commit 501783e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/concat_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ pub fn concat<I>(iterable: I) -> I::Item
where I: IntoIterator,
I::Item: Extend<<<I as IntoIterator>::Item as IntoIterator>::Item> + IntoIterator + Default
{
#[allow(deprecated)] //TODO: once msrv hits 1.51. replace `fold1` with `reduce`
iterable.into_iter().fold1(|mut a, b| { a.extend(b); a }).unwrap_or_default()
}
1 change: 1 addition & 0 deletions src/kmerge_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ impl<I, F> Iterator for KMergeBy<I, F>
}

fn size_hint(&self) -> (usize, Option<usize>) {
#[allow(deprecated)] //TODO: once msrv hits 1.51. replace `fold1` with `reduce`
self.heap.iter()
.map(|i| i.size_hint())
.fold1(size_hint::add)
Expand Down

0 comments on commit 501783e

Please sign in to comment.