std: fix fallout

This commit is contained in:
Jorge Aparicio 2015-01-01 22:33:39 -05:00
parent 6b116bedaf
commit 1971a24441
11 changed files with 93 additions and 37 deletions

View file

@ -52,7 +52,9 @@ impl<'r, R: Reader> Bytes<'r, R> {
}
}
impl<'r, R: Reader> Iterator<IoResult<u8>> for Bytes<'r, R> {
impl<'r, R: Reader> Iterator for Bytes<'r, R> {
type Item = IoResult<u8>;
#[inline]
fn next(&mut self) -> Option<IoResult<u8>> {
match self.reader.read_byte() {

View file

@ -563,7 +563,9 @@ pub struct Directories {
stack: Vec<Path>,
}
impl Iterator<Path> for Directories {
impl Iterator for Directories {
type Item = Path;
fn next(&mut self) -> Option<Path> {
match self.stack.pop() {
Some(path) => {

View file

@ -1371,7 +1371,9 @@ pub struct Lines<'r, T:'r> {
buffer: &'r mut T,
}
impl<'r, T: Buffer> Iterator<IoResult<String>> for Lines<'r, T> {
impl<'r, T: Buffer> Iterator for Lines<'r, T> {
type Item = IoResult<String>;
fn next(&mut self) -> Option<IoResult<String>> {
match self.buffer.read_line() {
Ok(x) => Some(Ok(x)),
@ -1398,7 +1400,9 @@ pub struct Chars<'r, T:'r> {
buffer: &'r mut T
}
impl<'r, T: Buffer> Iterator<IoResult<char>> for Chars<'r, T> {
impl<'r, T: Buffer> Iterator for Chars<'r, T> {
type Item = IoResult<char>;
fn next(&mut self) -> Option<IoResult<char>> {
match self.buffer.read_char() {
Ok(x) => Some(Ok(x)),
@ -1649,14 +1653,18 @@ pub struct IncomingConnections<'a, Sized? A:'a> {
}
#[cfg(stage0)]
impl<'a, T, A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A> {
impl<'a, T, A: Acceptor<T>> Iterator for IncomingConnections<'a, A> {
type Item = IoResult<T>;
fn next(&mut self) -> Option<IoResult<T>> {
Some(self.inc.accept())
}
}
#[cfg(not(stage0))]
impl<'a, T, Sized? A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A> {
impl<'a, T, Sized? A: Acceptor<T>> Iterator for IncomingConnections<'a, A> {
type Item = IoResult<T>;
fn next(&mut self) -> Option<IoResult<T>> {
Some(self.inc.accept())
}

View file

@ -169,7 +169,7 @@ pub struct ChainedReader<I, R> {
cur_reader: Option<R>,
}
impl<R: Reader, I: Iterator<R>> ChainedReader<I, R> {
impl<R: Reader, I: Iterator<Item=R>> ChainedReader<I, R> {
/// Creates a new `ChainedReader`
pub fn new(mut readers: I) -> ChainedReader<I, R> {
let r = readers.next();
@ -177,7 +177,7 @@ impl<R: Reader, I: Iterator<R>> ChainedReader<I, R> {
}
}
impl<R: Reader, I: Iterator<R>> Reader for ChainedReader<I, R> {
impl<R: Reader, I: Iterator<Item=R>> Reader for ChainedReader<I, R> {
fn read(&mut self, buf: &mut [u8]) -> io::IoResult<uint> {
loop {
let err = match self.cur_reader {
@ -252,7 +252,7 @@ pub struct IterReader<T> {
iter: T,
}
impl<T: Iterator<u8>> IterReader<T> {
impl<T: Iterator<Item=u8>> IterReader<T> {
/// Creates a new `IterReader` which will read from the specified
/// `Iterator`.
pub fn new(iter: T) -> IterReader<T> {
@ -260,7 +260,7 @@ impl<T: Iterator<u8>> IterReader<T> {
}
}
impl<T: Iterator<u8>> Reader for IterReader<T> {
impl<T: Iterator<Item=u8>> Reader for IterReader<T> {
#[inline]
fn read(&mut self, buf: &mut [u8]) -> io::IoResult<uint> {
let mut len = 0;