summary refs log tree commit diff
path: root/src/libtest/lib.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-21 23:17:33 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-03-22 01:08:57 +1100
commitbc3a10b9f9890ba2ddde4bdb1b734ec7685d91a6 (patch)
tree746f4286769ff3cd2dd9b8ea8168a13a86e9edca /src/libtest/lib.rs
parent6d778ff61058a18978a0c24d61f6a84e57138fa4 (diff)
downloadrust-bc3a10b9f9890ba2ddde4bdb1b734ec7685d91a6.tar.gz
rust-bc3a10b9f9890ba2ddde4bdb1b734ec7685d91a6.zip
Remove nearly all uses of `~[]` from libtest.
Deny further uses, with explicit allows on a few specific functions.
Diffstat (limited to 'src/libtest/lib.rs')
-rw-r--r--src/libtest/lib.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index 27f9a2174ce..96313c26f1f 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -33,7 +33,7 @@
       html_root_url = "http://static.rust-lang.org/doc/master")];
 
 #[feature(asm, macro_rules)];
-#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
+#[deny(deprecated_owned_vector)];
 
 extern crate collections;
 extern crate getopts;
@@ -363,15 +363,10 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
     match maybestr {
         None => None,
         Some(s) => {
-            let vector = s.split('.').to_owned_vec();
-            if vector.len() == 2 {
-                match (from_str::<uint>(vector[0]),
-                       from_str::<uint>(vector[1])) {
-                    (Some(a), Some(b)) => Some((a, b)),
-                    _ => None
-                }
-            } else {
-                None
+            let mut it = s.split('.');
+            match (it.next().and_then(from_str), it.next().and_then(from_str), it.next()) {
+                (Some(a), Some(b), None) => Some((a, b)),
+                _ => None,
             }
         }
     }
@@ -950,6 +945,7 @@ pub fn run_test(force_ignore: bool,
         return;
     }
 
+    #[allow(deprecated_owned_vector)]
     fn run_test_inner(desc: TestDesc,
                       monitor_ch: Sender<MonitorMsg>,
                       testfn: proc()) {