We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cd757a commit fcbff04Copy full SHA for fcbff04
library/core/src/iter/adapters/dedup.rs
@@ -149,8 +149,8 @@ where
149
150
#[inline]
151
fn size_hint(&self) -> (usize, Option<usize>) {
152
- let min = self.last.as_ref().map(|_| 1).unwrap_or(0);
153
- let max = self.inner.size_hint().1;
+ let min = matches!(self.last, Some(Some(_))).into();
+ let max = self.inner.size_hint().1.map(|max| max + min);
154
(min, max)
155
}
156
0 commit comments