about summary refs log tree commit diff
path: root/src/libnative/io
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-03-08 18:11:52 -0500
committerDaniel Micay <danielmicay@gmail.com>2014-03-20 01:30:27 -0400
commitce620320a20baa1428e679c751b1b4a8d8556ca1 (patch)
treef28a0234fe5f1d9509ef6cfa0c92448f7f29f7ec /src/libnative/io
parent4ca51aeea7187a63b987129d67cf7d348b6c60a9 (diff)
downloadrust-ce620320a20baa1428e679c751b1b4a8d8556ca1.tar.gz
rust-ce620320a20baa1428e679c751b1b4a8d8556ca1.zip
rename std::vec -> std::slice
Closes #12702
Diffstat (limited to 'src/libnative/io')
-rw-r--r--src/libnative/io/file_unix.rs4
-rw-r--r--src/libnative/io/file_win32.rs5
-rw-r--r--src/libnative/io/process.rs8
3 files changed, 8 insertions, 9 deletions
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs
index 1d7938be226..123a0414c9c 100644
--- a/src/libnative/io/file_unix.rs
+++ b/src/libnative/io/file_unix.rs
@@ -18,7 +18,7 @@ use std::libc::{c_int, c_void};
 use std::libc;
 use std::mem;
 use std::rt::rtio;
-use std::vec;
+use std::slice;
 use std::vec_ng::Vec;
 
 use io::{IoResult, retry, keep_going};
@@ -417,7 +417,7 @@ pub fn readlink(p: &CString) -> IoResult<Path> {
     if len == -1 {
         len = 1024; // FIXME: read PATH_MAX from C ffi?
     }
-    let mut buf = vec::with_capacity::<u8>(len as uint);
+    let mut buf = slice::with_capacity::<u8>(len as uint);
     match retry(|| unsafe {
         libc::readlink(p, buf.as_ptr() as *mut libc::c_char,
                        len as libc::size_t) as libc::c_int
diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs
index c5ae4f00017..28b963ab348 100644
--- a/src/libnative/io/file_win32.rs
+++ b/src/libnative/io/file_win32.rs
@@ -22,7 +22,7 @@ use std::ptr;
 use std::rt::rtio;
 use std::str;
 use std::sync::arc::UnsafeArc;
-use std::vec;
+use std::slice;
 
 use io::IoResult;
 
@@ -353,8 +353,7 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
                 if fp_buf as uint == 0 {
                     fail!("os::list_dir() failure: got null ptr from wfd");
                 } else {
-                    let fp_vec = vec::from_buf(fp_buf,
-                                               libc::wcslen(fp_buf) as uint);
+                    let fp_vec = slice::from_buf(fp_buf, libc::wcslen(fp_buf) as uint);
                     let fp_trimmed = str::truncate_utf16_at_nul(fp_vec);
                     let fp_str = str::from_utf16(fp_trimmed)
                             .expect("rust_list_dir_wfd_fp_buf returned invalid UTF-16");
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs
index 6ac1f2b3692..591c34e9be5 100644
--- a/src/libnative/io/process.rs
+++ b/src/libnative/io/process.rs
@@ -572,12 +572,12 @@ fn spawn_process_os(config: p::ProcessConfig,
 
 #[cfg(unix)]
 fn with_argv<T>(prog: &str, args: &[~str], cb: |**libc::c_char| -> T) -> T {
-    use std::vec;
+    use std::slice;
 
     // We can't directly convert `str`s into `*char`s, as someone needs to hold
     // a reference to the intermediary byte buffers. So first build an array to
     // hold all the ~[u8] byte strings.
-    let mut tmps = vec::with_capacity(args.len() + 1);
+    let mut tmps = slice::with_capacity(args.len() + 1);
 
     tmps.push(prog.to_c_str());
 
@@ -598,14 +598,14 @@ fn with_argv<T>(prog: &str, args: &[~str], cb: |**libc::c_char| -> T) -> T {
 
 #[cfg(unix)]
 fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: |*c_void| -> T) -> T {
-    use std::vec;
+    use std::slice;
 
     // On posixy systems we can pass a char** for envp, which is a
     // null-terminated array of "k=v\n" strings. Like `with_argv`, we have to
     // have a temporary buffer to hold the intermediary `~[u8]` byte strings.
     match env {
         Some(env) => {
-            let mut tmps = vec::with_capacity(env.len());
+            let mut tmps = slice::with_capacity(env.len());
 
             for pair in env.iter() {
                 let kv = format!("{}={}", *pair.ref0(), *pair.ref1());