diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-15 23:35:12 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-12-15 23:37:41 +1100 |
| commit | 164f7a290ef98377e4c8c158eca2fbed098a2842 (patch) | |
| tree | d9b2239b59f5d18bb680429595192fc64fdad6eb /src/libstd/io | |
| parent | f53292f7ee7365fe50ac216efac438ff5569fd06 (diff) | |
| download | rust-164f7a290ef98377e4c8c158eca2fbed098a2842.tar.gz rust-164f7a290ef98377e4c8c158eca2fbed098a2842.zip | |
std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/native/file.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/io/native/file.rs b/src/libstd/io/native/file.rs index 4e1c6bf982a..bd618dd6f0f 100644 --- a/src/libstd/io/native/file.rs +++ b/src/libstd/io/native/file.rs @@ -133,7 +133,7 @@ impl rtio::RtioFileStream for FileDesc { self.inner_write(buf) } fn pread(&mut self, buf: &mut [u8], offset: u64) -> Result<int, IoError> { - return os_pread(self.fd, vec::raw::to_ptr(buf), buf.len(), offset); + return os_pread(self.fd, buf.as_ptr(), buf.len(), offset); #[cfg(windows)] fn os_pread(fd: c_int, buf: *u8, amt: uint, offset: u64) -> IoResult<int> { @@ -165,7 +165,7 @@ impl rtio::RtioFileStream for FileDesc { } } fn pwrite(&mut self, buf: &[u8], offset: u64) -> Result<(), IoError> { - return os_pwrite(self.fd, vec::raw::to_ptr(buf), buf.len(), offset); + return os_pwrite(self.fd, buf.as_ptr(), buf.len(), offset); #[cfg(windows)] fn os_pwrite(fd: c_int, buf: *u8, amt: uint, offset: u64) -> IoResult<()> { @@ -700,7 +700,7 @@ pub fn readlink(p: &CString) -> IoResult<Path> { } let mut buf = vec::with_capacity::<u8>(len as uint); match unsafe { - libc::readlink(p, vec::raw::to_ptr(buf) as *mut libc::c_char, + libc::readlink(p, buf.as_ptr() as *mut libc::c_char, len as libc::size_t) } { -1 => Err(super::last_error()), |
