Skip to content

Commit fcbff04

Browse files
slerpyyycamsteffen
andcommitted
Update library/core/src/iter/adapters/dedup.rs
Co-authored-by: Cameron Steffen <cam.steffen94@gmail.com>
1 parent 6cd757a commit fcbff04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/iter/adapters/dedup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ where
149149

150150
#[inline]
151151
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;
152+
let min = matches!(self.last, Some(Some(_))).into();
153+
let max = self.inner.size_hint().1.map(|max| max + min);
154154
(min, max)
155155
}
156156
}

0 commit comments

Comments
 (0)