From 3d9c36fbf502100a46018119f73b70b89889de17 Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 4 Jan 2018 00:58:41 +0000 Subject: [PATCH] Add min specialisation for RangeFrom and last for RangeInclusive --- src/libcore/iter/range.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcore/iter/range.rs b/src/libcore/iter/range.rs index 19a76302f178..280f0eafcf02 100644 --- a/src/libcore/iter/range.rs +++ b/src/libcore/iter/range.rs @@ -305,6 +305,11 @@ impl Iterator for ops::RangeFrom { self.start = plus_n.add_one(); Some(plus_n) } + + #[inline] + fn min(self) -> Option { + Some(self.start) + } } #[unstable(feature = "fused", issue = "35602")] @@ -368,6 +373,11 @@ impl Iterator for ops::RangeInclusive { None } + #[inline] + fn last(self) -> Option { + Some(self.end) + } + #[inline] fn min(self) -> Option { Some(self.start)