libtest: remove unnecessary as_slice()
calls
This commit is contained in:
parent
53b479c195
commit
a0621f8eba
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user