We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get(r: Range)
Skip<Take>
1 parent f676f2f commit 7a9ce56Copy full SHA for 7a9ce56
src/iter_index.rs
@@ -37,11 +37,10 @@ impl<I> IteratorIndex<I> for Range<usize>
37
where
38
I: Iterator,
39
{
40
- type Output = Take<Skip<I>>;
+ type Output = Skip<Take<I>>;
41
42
fn index(self, iter: I) -> Self::Output {
43
- iter.skip(self.start)
44
- .take(self.end.saturating_sub(self.start))
+ iter.take(self.end).skip(self.start)
45
}
46
47
0 commit comments