]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/io/mod.rs
rollup merge of #17355 : gamazeps/issue17210
[rust.git] / src / libstd / io / mod.rs
index 804d6c79d23d0763a12083db8f7c85d11a1d7bad..ff508c802d8455cc36209048bba9abdd4e27a615 100644 (file)
@@ -578,7 +578,7 @@ fn read_at_least(&mut self, min: uint, buf: &mut [u8]) -> IoResult<uint> {
         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 {
@@ -945,7 +945,7 @@ fn by_ref<'a>(&'a mut self) -> RefReader<'a, Self> {
     }
 }
 
-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) }
 }
 
@@ -1279,7 +1279,7 @@ fn by_ref<'a>(&'a mut self) -> RefWriter<'a, Self> {
     }
 }
 
-impl Writer for Box<Writer+'static> {
+impl<'a> Writer for Box<Writer+'a> {
     #[inline]
     fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.write(buf) }
 
@@ -1418,7 +1418,7 @@ pub trait Buffer: Reader {
     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
@@ -1524,7 +1524,7 @@ fn read_char(&mut self) -> IoResult<char> {
         {
             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)),
@@ -1721,6 +1721,7 @@ pub enum FileType {
 /// # Example
 ///
 /// ```
+/// # use std::io::fs::PathExtensions;
 /// # fn main() {}
 /// # fn foo() {
 /// let info = match Path::new("foo.txt").stat() {