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/librustpkg | |
| parent | 2ff6b298c5f23f48aa993fced41b6e29e446b7ce (diff) | |
| download | rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.tar.gz rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.zip | |
std: replace str::each_split* with an iterator
Diffstat (limited to 'src/librustpkg')
| -rw-r--r-- | src/librustpkg/path_util.rs | 3 | ||||
| -rw-r--r-- | src/librustpkg/rustpkg.rc | 7 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustpkg/path_util.rs b/src/librustpkg/path_util.rs index af6b23ba755..c039eeacbe4 100644 --- a/src/librustpkg/path_util.rs +++ b/src/librustpkg/path_util.rs @@ -17,6 +17,7 @@ pub use target::{OutputType, Main, Lib, Test, Bench, Target, Build, Install}; use core::libc::consts::os::posix88::{S_IRUSR, S_IWUSR, S_IXUSR}; use core::os::mkdir_recursive; use core::os; +use core::iterator::IteratorUtil; /// Returns the value of RUST_PATH, as a list /// of Paths. In general this should be read from the @@ -166,7 +167,7 @@ fn library_in_workspace(full_name: &str, short_name: &str, where: Target, let f_name = match p_path.filename() { Some(s) => s, None => loop }; - for f_name.each_split_char('-') |piece| { + for f_name.split_iter('-').advance |piece| { debug!("a piece = %s", piece); if which == 0 && piece != lib_prefix { break; diff --git a/src/librustpkg/rustpkg.rc b/src/librustpkg/rustpkg.rc index 37b8c2ad433..2db51fe969f 100644 --- a/src/librustpkg/rustpkg.rc +++ b/src/librustpkg/rustpkg.rc @@ -29,6 +29,7 @@ extern mod syntax; use core::prelude::*; use core::*; +use core::iterator::IteratorUtil; pub use core::path::Path; use core::hashmap::HashMap; use rustc::driver::{driver, session}; @@ -161,10 +162,8 @@ impl<'self> PkgScript<'self> { exe.to_str(), root.to_str(), "configs"); let output = run::process_output(exe.to_str(), [root.to_str(), ~"configs"]); // Run the configs() function to get the configs - let mut cfgs = ~[]; - for str::each_word(str::from_bytes(output.output)) |w| { - cfgs.push(w.to_owned()); - } + let cfgs = str::from_bytes_slice(output.output).word_iter() + .transform(|w| w.to_owned()).collect(); (cfgs, output.status) } } |
