Skip to content

Commit 5f0e1bb

Browse files
committed
Use saturating_sub as per clippy warning
1 parent 514af56 commit 5f0e1bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/duplicates_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ mod private {
8989
// far), plus (hi - pending) / 2 pairs of never seen before items.
9090
let hi = hi.map(|hi| {
9191
let max_pending = std::cmp::min(self.meta.pending, hi);
92-
let max_new = hi.checked_sub(self.meta.pending).unwrap_or(0) / 2;
92+
let max_new = hi.saturating_sub(self.meta.pending) / 2;
9393
max_pending + max_new
9494
});
9595
// The lower bound is always 0 since we might only get unique items from now on

0 commit comments

Comments
 (0)