diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-08-01 03:16:42 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-08-01 05:34:55 -0400 |
| commit | 1fc4db2d086fd068a934c9ed2ccf25456fedc216 (patch) | |
| tree | 8e96cbc62b80bd622f78cf68b0bb29cb14ebc417 /src/libsyntax/ext/fmt.rs | |
| parent | 5f59c46e0f5605a0cc90ebdb26b4d258a8f7b43a (diff) | |
migrate many `for` loops to `foreach`
Diffstat (limited to 'src/libsyntax/ext/fmt.rs')
| -rw-r--r-- | src/libsyntax/ext/fmt.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index 855cf47111a..d8d114d1338 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -67,7 +67,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, fn make_rt_conv_expr(cx: @ExtCtxt, sp: span, cnv: &Conv) -> @ast::expr { fn make_flags(cx: @ExtCtxt, sp: span, flags: &[Flag]) -> @ast::expr { let mut tmp_expr = make_rt_path_expr(cx, sp, "flag_none"); - for flags.iter().advance |f| { + foreach f in flags.iter() { let fstr = match *f { FlagLeftJustify => "flag_left_justify", FlagLeftZeroPad => "flag_left_zero_pad", @@ -153,7 +153,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, option::None => (), _ => cx.span_unimpl(sp, unsupported) } - for cnv.flags.iter().advance |f| { + foreach f in cnv.flags.iter() { match *f { FlagLeftJustify => (), FlagSignAlways => { @@ -203,7 +203,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, Some(p) => { debug!("param: %s", p.to_str()); } _ => debug!("param: none") } - for c.flags.iter().advance |f| { + foreach f in c.flags.iter() { match *f { FlagLeftJustify => debug!("flag: left justify"), FlagLeftZeroPad => debug!("flag: left zero pad"), @@ -269,7 +269,7 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span, corresponding function in std::unstable::extfmt. Each function takes a buffer to insert data into along with the data being formatted. */ let npieces = pieces.len(); - for pieces.consume_iter().enumerate().advance |(i, pc)| { + foreach (i, pc) in pieces.consume_iter().enumerate() { match pc { /* Raw strings get appended via str::push_str */ PieceString(s) => { |
