about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-04-06 22:29:37 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-04-10 16:08:22 -0700
commit74807b15944205beb2b86ea5422927c47cac3ecc (patch)
treea68a98525fd86ed6646045c4255f328f29155871 /src/libsyntax
parent11f5f73b2b7b287cee16d300a10b1c50776c38d6 (diff)
downloadrust-74807b15944205beb2b86ea5422927c47cac3ecc.tar.gz
rust-74807b15944205beb2b86ea5422927c47cac3ecc.zip
syntax: match variants use 4 space indent by default
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/print/pprust.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index fa1b9727566..4e7e5144a7d 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -95,7 +95,6 @@ pub fn rust_printer(writer: @io::Writer, intr: @ident_interner) -> @ps {
 }
 
 pub static indent_unit: uint = 4u;
-pub static match_indent_unit: uint = 2u;
 
 pub static default_columns: uint = 78u;
 
@@ -1227,16 +1226,16 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) {
         print_block(s, blk);
       }
       ast::expr_match(expr, ref arms) => {
-        cbox(s, match_indent_unit);
+        cbox(s, indent_unit);
         ibox(s, 4);
         word_nbsp(s, ~"match");
         print_expr(s, expr);
         space(s.s);
         bopen(s);
-        let len = (*arms).len();
-        for (*arms).eachi |i, arm| {
+        let len = arms.len();
+        for arms.eachi |i, arm| {
             space(s.s);
-            cbox(s, match_indent_unit);
+            cbox(s, indent_unit);
             ibox(s, 0u);
             let mut first = true;
             for arm.pats.each |p| {
@@ -1269,7 +1268,7 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) {
                             ast::expr_block(ref blk) => {
                                 // the block will close the pattern's ibox
                                 print_block_unclosed_indent(
-                                    s, blk, match_indent_unit);
+                                    s, blk, indent_unit);
                             }
                             _ => {
                                 end(s); // close the ibox for the pattern
@@ -1286,10 +1285,10 @@ pub fn print_expr(s: @ps, &&expr: @ast::expr) {
                 }
             } else {
                 // the block will close the pattern's ibox
-                print_block_unclosed_indent(s, &arm.body, match_indent_unit);
+                print_block_unclosed_indent(s, &arm.body, indent_unit);
             }
         }
-        bclose_(s, expr.span, match_indent_unit);
+        bclose_(s, expr.span, indent_unit);
       }
       ast::expr_fn_block(ref decl, ref body) => {
         // in do/for blocks we don't want to show an empty