]> git.lizzy.rs Git - rust.git/commitdiff
RIMOV core::io
authorBen Striegel <ben.striegel@gmail.com>
Tue, 12 Feb 2013 04:18:34 +0000 (23:18 -0500)
committerBen Striegel <ben.striegel@gmail.com>
Wed, 13 Feb 2013 17:47:44 +0000 (12:47 -0500)
src/libcore/io.rs

index 721a6584c650677e136cbbbde7dc23ab8f0d5534..c1e47439e9280588aa0c7626e17c5ab83f1f908f 100644 (file)
@@ -56,7 +56,7 @@ pub trait Reader {
     /// Read up to len bytes (or EOF) and put them into bytes (which
     /// must be at least len bytes long). Return number of bytes read.
     // FIXME (#2982): This should probably return an error.
-    fn read(&self, bytes: &[mut u8], len: uint) -> uint;
+    fn read(&self, bytes: &mut [u8], len: uint) -> uint;
 
     /// Read a single byte, returning a negative value for EOF or read error.
     fn read_byte(&self) -> int;
@@ -416,7 +416,7 @@ fn convert_whence(whence: SeekStyle) -> i32 {
 }
 
 impl *libc::FILE: Reader {
-    fn read(&self, bytes: &[mut u8], len: uint) -> uint {
+    fn read(&self, bytes: &mut [u8], len: uint) -> uint {
         unsafe {
             do vec::as_mut_buf(bytes) |buf_p, buf_len| {
                 assert buf_len >= len;
@@ -461,7 +461,7 @@ struct Wrapper<T, C> {
 // duration of its lifetime.
 // FIXME there really should be a better way to do this // #2004
 impl<R: Reader, C> Wrapper<R, C>: Reader {
-    fn read(&self, bytes: &[mut u8], len: uint) -> uint {
+    fn read(&self, bytes: &mut [u8], len: uint) -> uint {
         self.base.read(bytes, len)
     }
     fn read_byte(&self) -> int { self.base.read_byte() }
@@ -528,7 +528,7 @@ pub struct BytesReader {
 }
 
 impl BytesReader: Reader {
-    fn read(&self, bytes: &[mut u8], len: uint) -> uint {
+    fn read(&self, bytes: &mut [u8], len: uint) -> uint {
         let count = uint::min(len, self.bytes.len() - self.pos);
 
         let view = vec::view(self.bytes, self.pos, self.bytes.len());