From 164f7a290ef98377e4c8c158eca2fbed098a2842 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 15 Dec 2013 23:35:12 +1100 Subject: std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut []. --- src/libstd/io/native/file.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd/io/native') 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 { - 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 { @@ -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 { } let mut buf = vec::with_capacity::(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()), -- cgit 1.4.1-3-g733a5