From c356e3ba6a12c3294a9a428ef9120cff9306bf4b Mon Sep 17 00:00:00 2001 From: Marvin Löbel Date: Fri, 28 Mar 2014 20:42:34 +0100 Subject: Removed deprecated functions `map` and `flat_map` for vectors and slices. --- src/libnative/io/process.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libnative') diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index 463f9f8bedd..b0f2495e98c 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -597,7 +597,7 @@ fn with_argv(prog: &str, args: &[~str], cb: proc:(**libc::c_char) -> T) -> T // Next, convert each of the byte strings into a pointer. This is // technically unsafe as the caller could leak these pointers out of our // scope. - let mut ptrs = tmps.map(|tmp| tmp.with_ref(|buf| buf)); + let mut ptrs: Vec<_> = tmps.iter().map(|tmp| tmp.with_ref(|buf| buf)).collect(); // Finally, make sure we add a null pointer. ptrs.push(ptr::null()); @@ -622,7 +622,9 @@ fn with_envp(env: Option<~[(~str, ~str)]>, cb: proc:(*c_void) -> T) -> T { } // Once again, this is unsafe. - let mut ptrs = tmps.map(|tmp| tmp.with_ref(|buf| buf)); + let mut ptrs: Vec<*libc::c_char> = tmps.iter() + .map(|tmp| tmp.with_ref(|buf| buf)) + .collect(); ptrs.push(ptr::null()); cb(ptrs.as_ptr() as *c_void) -- cgit 1.4.1-3-g733a5