Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-itertools/itertools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 74bcfe406b2a43b5a3c44a234ec4a9ff52f77619
Choose a base ref
..
head repository: rust-itertools/itertools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 986992ab31d6eecde39e9f59edde862d2b3de07f
Choose a head ref
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/tuple_impl.rs
3 changes: 2 additions & 1 deletion src/tuple_impl.rs
Original file line number Diff line number Diff line change
@@ -56,14 +56,15 @@ impl<T> Iterator for TupleBuffer<T>
}
}

#[allow(clippy::unnecessary_lazy_evaluations)] // buffer.len is more complex than usual
fn size_hint(&self) -> (usize, Option<usize>) {
let buffer = &self.buf.as_ref()[self.cur..];
let len = if buffer.is_empty() {
0
} else {
buffer.iter()
.position(Option::is_none)
.unwrap_or(buffer.len())
.unwrap_or_else(|| buffer.len())
};
(len, Some(len))
}