Skip to content

Commit 41aacfc

Browse files
committed
fix clippy::unnecessary_lazy_evaluations
1 parent 7cc7702 commit 41aacfc

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/concat_impl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ pub fn concat<I>(iterable: I) -> I::Item
1818
where I: IntoIterator,
1919
I::Item: Extend<<<I as IntoIterator>::Item as IntoIterator>::Item> + IntoIterator + Default
2020
{
21+
#[allow(deprecated)] //TODO: once msrv hits 1.51. replace `fold1` with `reduce`
2122
iterable.into_iter().fold1(|mut a, b| { a.extend(b); a }).unwrap_or_default()
2223
}

src/kmerge_impl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ impl<I, F> Iterator for KMergeBy<I, F>
213213
}
214214

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

src/tuple_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<T> Iterator for TupleBuffer<T>
6363
} else {
6464
buffer.iter()
6565
.position(|x| x.is_none())
66-
.unwrap_or_else(|| buffer.len())
66+
.unwrap_or(buffer.len())
6767
};
6868
(len, Some(len))
6969
}

0 commit comments

Comments
 (0)