summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2012-08-02 15:42:56 -0700
committerNiko Matsakis <niko@alum.mit.edu>2012-08-02 15:53:28 -0700
commit97452c0ca16238a2de5503aca07db26ff9e8ba63 (patch)
tree47ef430d1671ab297bc192009aa74a23723a42fc /src/libsyntax/print
parent476ce459bd3b687658e566c75d0fb73281450d67 (diff)
downloadrust-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.rs13
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"
     }
 }