diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-10 19:46:38 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-21 23:31:42 -0800 |
| commit | 082bfde412176249dc7328e771a2a15d202824cf (patch) | |
| tree | 4df3816d6ffea2f52bf5fa51fe385806ed529ba7 /src/libtest | |
| parent | 4908017d59da8694b9ceaf743baf1163c1e19086 (diff) | |
| download | rust-082bfde412176249dc7328e771a2a15d202824cf.tar.gz rust-082bfde412176249dc7328e771a2a15d202824cf.zip | |
Fallout of std::str stabilization
Diffstat (limited to 'src/libtest')
| -rw-r--r-- | src/libtest/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 5b04a1fed89..1870f162ece 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -65,6 +65,7 @@ use std::io::fs::PathExtensions; use std::io::stdio::StdWriter; use std::io::{File, ChanReader, ChanWriter}; use std::io; +use std::iter::repeat; use std::num::{Float, FloatMath, Int}; use std::os; use std::str::FromStr; @@ -121,7 +122,7 @@ impl TestDesc { fn padded_name(&self, column_count: uint, align: NamePadding) -> String { let mut name = String::from_str(self.name.as_slice()); let fill = column_count.saturating_sub(name.len()); - let mut pad = " ".repeat(fill); + let mut pad = repeat(" ").take(fill).collect::<String>(); match align { PadNone => name, PadOnLeft => { @@ -426,7 +427,7 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> { let ratchet_noise_percent = matches.opt_str("ratchet-noise-percent"); let ratchet_noise_percent = - ratchet_noise_percent.map(|s| from_str::<f64>(s.as_slice()).unwrap()); + ratchet_noise_percent.map(|s| s.as_slice().parse::<f64>().unwrap()); let save_metrics = matches.opt_str("save-metrics"); let save_metrics = save_metrics.map(|s| Path::new(s)); @@ -489,7 +490,8 @@ pub fn opt_shard(maybestr: Option<String>) -> Option<(uint,uint)> { None => None, Some(s) => { let mut it = s.split('.'); - match (it.next().and_then(from_str::<uint>), it.next().and_then(from_str::<uint>), + match (it.next().and_then(|s| s.parse::<uint>()), + it.next().and_then(|s| s.parse::<uint>()), it.next()) { (Some(a), Some(b), None) => { if a <= 0 || a > b { |
