about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-02-01 21:53:25 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-02-05 13:45:01 -0500
commit17bc7d8d5be3be9674d702ccad2fa88c487d23b0 (patch)
tree325defba0f55b48273cd3f0814fe6c083dee5d41 /src/libstd/sys/windows
parent2c05354211b04a52cc66a0b8ad8b2225eaf9e972 (diff)
downloadrust-17bc7d8d5be3be9674d702ccad2fa88c487d23b0.tar.gz
rust-17bc7d8d5be3be9674d702ccad2fa88c487d23b0.zip
cleanup: replace `as[_mut]_slice()` calls with deref coercions
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/process.rs9
-rw-r--r--src/libstd/sys/windows/tty.rs2
2 files changed, 5 insertions, 6 deletions
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<char> = 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::<Vec<CString>>()
-                                  .as_slice())
+                              &args.iter()
+                                   .map(|a| CString::from_slice(a.as_bytes()))
+                                   .collect::<Vec<CString>>())
         }
 
         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()),
             };