Add min specialisation for RangeFrom and last for RangeInclusive
This commit is contained in:
parent
680ebf7b16
commit
3d9c36fbf5
1 changed files with 10 additions and 0 deletions
|
|
@ -305,6 +305,11 @@ impl<A: Step> Iterator for ops::RangeFrom<A> {
|
|||
self.start = plus_n.add_one();
|
||||
Some(plus_n)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn min(self) -> Option<A> {
|
||||
Some(self.start)
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "fused", issue = "35602")]
|
||||
|
|
@ -368,6 +373,11 @@ impl<A: Step> Iterator for ops::RangeInclusive<A> {
|
|||
None
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn last(self) -> Option<A> {
|
||||
Some(self.end)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn min(self) -> Option<A> {
|
||||
Some(self.start)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue