about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2017-01-27 09:14:26 +1300
committerNick Cameron <ncameron@mozilla.com>2017-01-27 09:14:26 +1300
commit6054f28bd2c2b617d4d494c5e27e09b4b16db1d2 (patch)
tree8935cafcc0cbeddfded43f79f7cfb4d4aa9c245c /src
parente56ef44a3a27d1f609a20aacbdd2919f225175a9 (diff)
Some debugging stuff
Diffstat (limited to 'src')
-rw-r--r--src/expr.rs2
-rw-r--r--src/items.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/expr.rs b/src/expr.rs
index 435155de28f..80937d76da7 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -694,6 +694,7 @@ impl Rewrite for ast::Stmt {
 }
 
 // Abstraction over control flow expressions
+#[derive(Debug)]
 struct ControlFlow<'a> {
     cond: Option<&'a ast::Expr>,
     block: &'a ast::Block,
@@ -845,6 +846,7 @@ impl<'a> ControlFlow<'a> {
 
 impl<'a> Rewrite for ControlFlow<'a> {
     fn rewrite(&self, context: &RewriteContext, width: usize, offset: Indent) -> Option<String> {
+        debug!("ControlFlow::rewrite {:?} {} {:?}", self, width, offset);
         let (budget, indent) = if self.nested_if {
             // We are part of an if-elseif-else chain. Our constraints are tightened.
             // 7 = "} else " .len()
diff --git a/src/items.rs b/src/items.rs
index 3a1c70ccb3f..8270a52ce76 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -31,6 +31,7 @@ use syntax::ast::ImplItem;
 // let pat: ty = init;
 impl Rewrite for ast::Local {
     fn rewrite(&self, context: &RewriteContext, width: usize, offset: Indent) -> Option<String> {
+        debug!("Local::rewrite {:?} {} {:?}", self, width, offset);
         let mut result = "let ".to_owned();
         let pattern_offset = offset + result.len();
         // 1 = ;
@@ -64,9 +65,9 @@ impl Rewrite for ast::Local {
         result.push_str(&infix);
 
         if let Some(ref ex) = self.init {
+            // 1 = trailing semicolon;
             let budget = try_opt!(width.checked_sub(context.block_indent.width() + 1));
 
-            // 1 = trailing semicolon;
             result =
                 try_opt!(rewrite_assign_rhs(&context, result, ex, budget, context.block_indent));
         }