]> git.lizzy.rs Git - rust.git/commitdiff
libtest: remove unnecessary `as_slice()` calls
authorJorge Aparicio <japaricious@gmail.com>
Thu, 27 Nov 2014 20:06:09 +0000 (15:06 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Sun, 7 Dec 2014 04:53:01 +0000 (23:53 -0500)
src/libtest/lib.rs
src/libtest/stats.rs

index c943d8706e55b71cf96dc8018294bb25908bc559..184195b988ae44be1f9d91fa16a3f75e6b68c329 100644 (file)
@@ -471,7 +471,7 @@ pub fn opt_shard(maybestr: Option<String>) -> Option<(uint,uint)> {
     match maybestr {
         None => None,
         Some(s) => {
-            let mut it = s.as_slice().split('.');
+            let mut it = s.split('.');
             match (it.next().and_then(from_str::<uint>), it.next().and_then(from_str::<uint>),
                    it.next()) {
                 (Some(a), Some(b), None) => {
@@ -934,8 +934,8 @@ fn should_sort_failures_before_printing_them() {
         Pretty(_) => unreachable!()
     };
 
-    let apos = s.as_slice().find_str("a").unwrap();
-    let bpos = s.as_slice().find_str("b").unwrap();
+    let apos = s.find_str("a").unwrap();
+    let bpos = s.find_str("b").unwrap();
     assert!(apos < bpos);
 }
 
index c157fb10bd4a7d8167cd274858f5d09369e9ff24..f9e6907f0e880d4be5aad6b342fa938c9b5ff777 100644 (file)
@@ -250,7 +250,7 @@ fn median_abs_dev(&self) -> T {
         // This constant is derived by smarter statistics brains than me, but it is
         // consistent with how R and other packages treat the MAD.
         let number = FromPrimitive::from_f64(1.4826).unwrap();
-        abs_devs.as_slice().median() * number
+        abs_devs.median() * number
     }
 
     fn median_abs_dev_pct(&self) -> T {