iterator: cleanup
This commit is contained in:
parent
45426c3b4c
commit
fe047e07ba
1 changed files with 3 additions and 4 deletions
|
@ -174,6 +174,7 @@ pub trait Iterator<A> {
|
||||||
/// assert!(it.peek().is_none());
|
/// assert!(it.peek().is_none());
|
||||||
/// assert!(it.next().is_none());
|
/// assert!(it.next().is_none());
|
||||||
/// ~~~
|
/// ~~~
|
||||||
|
#[inline]
|
||||||
fn peekable(self) -> Peekable<A, Self> {
|
fn peekable(self) -> Peekable<A, Self> {
|
||||||
Peekable{iter: self, peeked: None}
|
Peekable{iter: self, peeked: None}
|
||||||
}
|
}
|
||||||
|
@ -931,8 +932,7 @@ impl<'self, A, B, T: Iterator<A>> Iterator<B> for Map<'self, A, B, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self, A, B, T: DoubleEndedIterator<A>> DoubleEndedIterator<B>
|
impl<'self, A, B, T: DoubleEndedIterator<A>> DoubleEndedIterator<B> for Map<'self, A, B, T> {
|
||||||
for Map<'self, A, B, T> {
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn next_back(&mut self) -> Option<B> {
|
fn next_back(&mut self) -> Option<B> {
|
||||||
let next = self.iter.next_back();
|
let next = self.iter.next_back();
|
||||||
|
@ -940,8 +940,7 @@ for Map<'self, A, B, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self, A, B, T: RandomAccessIterator<A>> RandomAccessIterator<B>
|
impl<'self, A, B, T: RandomAccessIterator<A>> RandomAccessIterator<B> for Map<'self, A, B, T> {
|
||||||
for Map<'self, A, B, T> {
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn indexable(&self) -> uint {
|
fn indexable(&self) -> uint {
|
||||||
self.iter.indexable()
|
self.iter.indexable()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue