diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-29 15:05:50 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-30 21:59:44 +1000 |
| commit | c0a20d2929a7c0d6af0de899198df4f26453d877 (patch) | |
| tree | 8347aea61a2f042c6114cadae3e11233582d22d5 /src/libsyntax/ext/source_util.rs | |
| parent | a396e1e2e95acc07f2804be2079d5b692753d4bb (diff) | |
| download | rust-c0a20d2929a7c0d6af0de899198df4f26453d877.tar.gz rust-c0a20d2929a7c0d6af0de899198df4f26453d877.zip | |
Remove vec::{map, mapi, zip_map} and the methods, except for .map, since this
is very common, and the replacement (.iter().transform().collect()) is very ugly.
Diffstat (limited to 'src/libsyntax/ext/source_util.rs')
| -rw-r--r-- | src/libsyntax/ext/source_util.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 71dc82be414..f6325c2eb2c 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -21,7 +21,6 @@ use print::pprust; use std::io; use std::result; -use std::vec; // These macros all relate to the file system; they either return // the column/row/filename of the expression, or they include @@ -106,9 +105,7 @@ pub fn expand_include_bin(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree]) let file = get_single_str_from_tts(cx, sp, tts, "include_bin!"); match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) { result::Ok(src) => { - let u8_exprs = vec::map(src, |char| { - cx.expr_u8(sp, *char) - }); + let u8_exprs: ~[@ast::expr] = src.iter().transform(|char| cx.expr_u8(sp, *char)).collect(); base::MRExpr(cx.expr_vec(sp, u8_exprs)) } result::Err(ref e) => { |
