while read < min {
let mut zeroes = 0;
loop {
- match self.read(buf.mut_slice_from(read)) {
+ match self.read(buf.slice_from_mut(read)) {
Ok(0) => {
zeroes += 1;
if zeroes >= NO_PROGRESS_LIMIT {
}
}
-impl Reader for Box<Reader+'static> {
+impl<'a> Reader for Box<Reader+'a> {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { self.read(buf) }
}
}
}
-impl Writer for Box<Writer+'static> {
+impl<'a> Writer for Box<Writer+'a> {
#[inline]
fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.write(buf) }
fn consume(&mut self, amt: uint);
/// Reads the next line of input, interpreted as a sequence of UTF-8
- /// encoded unicode codepoints. If a newline is encountered, then the
+ /// encoded Unicode codepoints. If a newline is encountered, then the
/// newline is contained in the returned string.
///
/// # Example
{
let mut start = 1;
while start < width {
- match try!(self.read(buf.mut_slice(start, width))) {
+ match try!(self.read(buf.slice_mut(start, width))) {
n if n == width - start => break,
n if n < width - start => { start += n; }
_ => return Err(standard_error(InvalidInput)),
/// # Example
///
/// ```
+/// # use std::io::fs::PathExtensions;
/// # fn main() {}
/// # fn foo() {
/// let info = match Path::new("foo.txt").stat() {