From 8872b783e662b005082f077690fcf36c735da8e0 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 6 Aug 2013 00:02:42 -0700 Subject: [PATCH] Fix size_hint on Skip If the upper bound of the wrapped iterator has saturated at uint::max_value, keep it there. It may actually represent an upper bound that is higher. --- src/libstd/iterator.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 1be398966bbeb..33505213082ca 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -1266,6 +1266,8 @@ impl> Iterator for Skip { let lower = lower.saturating_sub(self.n); let upper = match upper { + // if uint::max_value, leave it there + Some(x) if x == uint::max_value => Some(x), Some(x) => Some(x.saturating_sub(self.n)), None => None };