libtest: remove unnecessary as_slice() calls

This commit is contained in:
Jorge Aparicio 2014-11-27 15:06:09 -05:00
parent 53b479c195
commit a0621f8eba
2 changed files with 4 additions and 4 deletions

View 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);
}

View File

@ -250,7 +250,7 @@ impl<T: FloatMath + FromPrimitive> Stats<T> for [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 {