diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-09 23:10:50 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:02:54 +1000 |
| commit | 1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46 (patch) | |
| tree | 54f03a318e14bcdbdb56e01b3c80d00a9db87a17 /src/test | |
| parent | 2ff6b298c5f23f48aa993fced41b6e29e446b7ce (diff) | |
| download | rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.tar.gz rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.zip | |
std: replace str::each_split* with an iterator
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/bench/sudoku.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index 3bf08cfb934..d05edef25a6 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -14,6 +14,7 @@ extern mod extra; use std::io::{ReaderUtil, WriterUtil}; use std::io; +use std::iterator::IteratorUtil; use std::os; use std::str; use std::u8; @@ -73,8 +74,8 @@ impl Sudoku { let mut g = vec::from_fn(10u, { |_i| ~[0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8] }); while !reader.eof() { let line = reader.read_line(); - let mut comps = ~[]; - for str::each_split_char(line.trim(), ',') |s| { comps.push(s.to_owned()) } + let comps: ~[&str] = line.trim().split_iter(',').collect(); + if comps.len() == 3u { let row = uint::from_str(comps[0]).get() as u8; let col = uint::from_str(comps[1]).get() as u8; |
