From 17bc7d8d5be3be9674d702ccad2fa88c487d23b0 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 1 Feb 2015 21:53:25 -0500 Subject: cleanup: replace `as[_mut]_slice()` calls with deref coercions --- src/libstd/sys/windows/process.rs | 9 ++++----- src/libstd/sys/windows/tty.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index 839263f1f17..eab60047aa2 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -389,7 +389,7 @@ fn make_command_line(prog: &CString, args: &[CString]) -> String { } let argvec: Vec = arg.chars().collect(); for i in 0u..argvec.len() { - append_char_at(cmd, argvec.as_slice(), i); + append_char_at(cmd, &argvec, i); } if quote { cmd.push('"'); @@ -485,10 +485,9 @@ mod tests { fn test_make_command_line() { fn test_wrapper(prog: &str, args: &[&str]) -> String { make_command_line(&CString::from_slice(prog.as_bytes()), - args.iter() - .map(|a| CString::from_slice(a.as_bytes())) - .collect::>() - .as_slice()) + &args.iter() + .map(|a| CString::from_slice(a.as_bytes())) + .collect::>()) } assert_eq!( diff --git a/src/libstd/sys/windows/tty.rs b/src/libstd/sys/windows/tty.rs index f02c8e49f41..8a8b5309057 100644 --- a/src/libstd/sys/windows/tty.rs +++ b/src/libstd/sys/windows/tty.rs @@ -104,7 +104,7 @@ impl TTY { _ => (), }; utf16.truncate(num as uint); - let utf8 = match String::from_utf16(utf16.as_slice()) { + let utf8 = match String::from_utf16(&utf16) { Ok(utf8) => utf8.into_bytes(), Err(..) => return Err(invalid_encoding()), }; -- cgit 1.4.1-3-g733a5