diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-20 16:23:04 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-26 08:24:18 -0800 |
| commit | efc512362b0f2ae200ef079e3566c6b158a857cc (patch) | |
| tree | f13bd8c52a12ebff5bc304312aa9708bf34780dc /src/libsyntax/print/pprust.rs | |
| parent | a61a3678ebe5571842d4223e2a0313714893bbf7 (diff) | |
| download | rust-efc512362b0f2ae200ef079e3566c6b158a857cc.tar.gz rust-efc512362b0f2ae200ef079e3566c6b158a857cc.zip | |
libsyntax: Remove all non-`proc` `do` syntax.
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index c41460485da..a8f82221fa1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -704,7 +704,7 @@ pub fn print_struct(s: @ps, if ast_util::struct_def_is_tuple_like(struct_def) { if !struct_def.fields.is_empty() { popen(s); - do commasep(s, inconsistent, struct_def.fields) |s, field| { + commasep(s, inconsistent, struct_def.fields, |s, field| { match field.node.kind { ast::named_field(*) => fail!("unexpected named field"), ast::unnamed_field => { @@ -712,7 +712,7 @@ pub fn print_struct(s: @ps, print_type(s, &field.node.ty); } } - } + }); pclose(s); } word(s.s, ";"); @@ -1699,9 +1699,7 @@ pub fn print_pat(s: @ps, pat: &ast::Pat) { } ast::PatVec(ref before, slice, ref after) => { word(s.s, "["); - do commasep(s, inconsistent, *before) |s, &p| { - print_pat(s, p); - } + commasep(s, inconsistent, *before, |s, &p| print_pat(s, p)); for &p in slice.iter() { if !before.is_empty() { word_space(s, ","); } match p { @@ -1713,9 +1711,7 @@ pub fn print_pat(s: @ps, pat: &ast::Pat) { print_pat(s, p); if !after.is_empty() { word_space(s, ","); } } - do commasep(s, inconsistent, *after) |s, &p| { - print_pat(s, p); - } + commasep(s, inconsistent, *after, |s, &p| print_pat(s, p)); word(s.s, "]"); } } @@ -1937,9 +1933,9 @@ pub fn print_view_path(s: @ps, vp: &ast::view_path) { ast::view_path_list(ref path, ref idents, _) => { print_path(s, path, false); word(s.s, "::{"); - do commasep(s, inconsistent, (*idents)) |s, w| { + commasep(s, inconsistent, (*idents), |s, w| { print_ident(s, w.node.name); - } + }); word(s.s, "}"); } } @@ -2053,9 +2049,7 @@ pub fn print_ty_fn(s: @ps, match id { Some(id) => { word(s.s, " "); print_ident(s, id); } _ => () } if opt_sigil != Some(ast::BorrowedSigil) { - do opt_bounds.as_ref().map |bounds| { - print_bounds(s, bounds, true); - }; + opt_bounds.as_ref().map(|bounds| print_bounds(s, bounds, true)); } match generics { Some(g) => print_generics(s, g), _ => () } @@ -2157,9 +2151,7 @@ pub fn print_literal(s: @ps, lit: &ast::lit) { ast::lit_str(st, style) => print_string(s, st, style), ast::lit_char(ch) => { let mut res = ~"'"; - do char::from_u32(ch).unwrap().escape_default |c| { - res.push_char(c); - } + char::from_u32(ch).unwrap().escape_default(|c| res.push_char(c)); res.push_char('\''); word(s.s, res); } |
