diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-08-02 15:42:56 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-08-02 15:53:28 -0700 |
| commit | 97452c0ca16238a2de5503aca07db26ff9e8ba63 (patch) | |
| tree | 47ef430d1671ab297bc192009aa74a23723a42fc /src/libsyntax/print | |
| parent | 476ce459bd3b687658e566c75d0fb73281450d67 (diff) | |
| download | rust-97452c0ca16238a2de5503aca07db26ff9e8ba63.tar.gz rust-97452c0ca16238a2de5503aca07db26ff9e8ba63.zip | |
Remove modes from map API and replace with regions.
API is (for now) mostly by value, there are options to use it by reference if you like. Hash and equality functions must be pure and by reference (forward looking to the day when something like send_map becomes the standard map).
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 6a2b5c787de..02a888e4022 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -467,12 +467,13 @@ fn print_item(s: ps, &&item: @ast::item) { ast::item_enum(variants, params) { let newtype = vec::len(variants) == 1u && - str::eq(*item.ident, *variants[0].node.name) && + str::eq(item.ident, variants[0].node.name) && vec::len(variants[0].node.args) == 1u; if newtype { ibox(s, indent_unit); word_space(s, ~"enum"); } else { head(s, ~"enum"); } + word(s.s, *item.ident); print_type_params(s, params); space(s.s); @@ -1789,12 +1790,12 @@ fn opt_proto_to_str(opt_p: option<ast::proto>) -> ~str { } } -fn purity_to_str(p: ast::purity) -> ~str { +pure fn purity_to_str(p: ast::purity) -> ~str { alt p { - ast::impure_fn {~"impure"} - ast::unsafe_fn {~"unsafe"} - ast::pure_fn {~"pure"} - ast::extern_fn {~"extern"} + ast::impure_fn => ~"impure", + ast::unsafe_fn => ~"unsafe", + ast::pure_fn => ~"pure", + ast::extern_fn => ~"extern" } } |
