about summary refs log tree commit diff
path: root/src/test/run-make/unicode-input
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/test/run-make/unicode-input
parent2c05354211b04a52cc66a0b8ad8b2225eaf9e972 (diff)
downloadrust-17bc7d8d5be3be9674d702ccad2fa88c487d23b0.tar.gz
rust-17bc7d8d5be3be9674d702ccad2fa88c487d23b0.zip
cleanup: replace `as[_mut]_slice()` calls with deref coercions
Diffstat (limited to 'src/test/run-make/unicode-input')
-rw-r--r--src/test/run-make/unicode-input/multiple_files.rs14
-rw-r--r--src/test/run-make/unicode-input/span_length.rs16
2 files changed, 15 insertions, 15 deletions
diff --git a/src/test/run-make/unicode-input/multiple_files.rs b/src/test/run-make/unicode-input/multiple_files.rs
index f9ffdffb464..be67e5a066a 100644
--- a/src/test/run-make/unicode-input/multiple_files.rs
+++ b/src/test/run-make/unicode-input/multiple_files.rs
@@ -34,8 +34,8 @@ fn random_char() -> char {
 
 fn main() {
     let args = os::args();
-    let rustc = args[1].as_slice();
-    let tmpdir = Path::new(args[2].as_slice());
+    let rustc = &args[1];
+    let tmpdir = Path::new(&args[2]);
 
     let main_file = tmpdir.join("unicode_input_multiple_files_main.rs");
     {
@@ -56,12 +56,12 @@ fn main() {
         // can't exec it directly
         let result = Command::new("sh")
                              .arg("-c")
-                             .arg(format!("{} {}",
-                                          rustc,
-                                          main_file.as_str()
-                                                   .unwrap()).as_slice())
+                             .arg(&format!("{} {}",
+                                           rustc,
+                                           main_file.as_str()
+                                                    .unwrap()))
                              .output().unwrap();
-        let err = String::from_utf8_lossy(result.error.as_slice());
+        let err = String::from_utf8_lossy(&result.error);
 
         // positive test so that this test will be updated when the
         // compiler changes.
diff --git a/src/test/run-make/unicode-input/span_length.rs b/src/test/run-make/unicode-input/span_length.rs
index 9ee7516c7ba..95ce57da4e1 100644
--- a/src/test/run-make/unicode-input/span_length.rs
+++ b/src/test/run-make/unicode-input/span_length.rs
@@ -34,8 +34,8 @@ fn random_char() -> char {
 
 fn main() {
     let args = os::args();
-    let rustc = args[1].as_slice();
-    let tmpdir = Path::new(args[2].as_slice());
+    let rustc = &args[1];
+    let tmpdir = Path::new(&args[2]);
     let main_file = tmpdir.join("span_main.rs");
 
     for _ in 0u..100 {
@@ -52,18 +52,18 @@ fn main() {
         // can't exec it directly
         let result = Command::new("sh")
                              .arg("-c")
-                             .arg(format!("{} {}",
-                                          rustc,
-                                          main_file.as_str()
-                                                   .unwrap()).as_slice())
+                             .arg(&format!("{} {}",
+                                           rustc,
+                                           main_file.as_str()
+                                                    .unwrap()))
                              .output().unwrap();
 
-        let err = String::from_utf8_lossy(result.error.as_slice());
+        let err = String::from_utf8_lossy(&result.error);
 
         // the span should end the line (e.g no extra ~'s)
         let expected_span = format!("^{}\n", repeat("~").take(n - 1)
                                                         .collect::<String>());
-        assert!(err.contains(expected_span.as_slice()));
+        assert!(err.contains(&expected_span));
     }
 
     // Test multi-column characters and tabs