diff options
| author | Ben Striegel <ben.striegel@gmail.com> | 2013-02-11 23:18:34 -0500 |
|---|---|---|
| committer | Ben Striegel <ben.striegel@gmail.com> | 2013-02-13 12:47:44 -0500 |
| commit | 808ccd33495452e6fce56cbd7e889c88e39fccff (patch) | |
| tree | 6414ae5d3165f9aefe520e185974ccfaf628ce69 /src | |
| parent | 3a3f7b8e557aa9ff8e99a11c826ffc6e1147e414 (diff) | |
| download | rust-808ccd33495452e6fce56cbd7e889c88e39fccff.tar.gz rust-808ccd33495452e6fce56cbd7e889c88e39fccff.zip | |
RIMOV core::io
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/io.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/io.rs b/src/libcore/io.rs index 721a6584c65..c1e47439e92 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -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()); |
