From c0a20d2929a7c0d6af0de899198df4f26453d877 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sat, 29 Jun 2013 15:05:50 +1000 Subject: 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. --- src/libsyntax/ext/source_util.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/libsyntax/ext/source_util.rs') 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) => { -- cgit 1.4.1-3-g733a5