From 762db5138e3c859f3dd736a46798615c561831a1 Mon Sep 17 00:00:00 2001
From: Seiichi Uchida <topecongiro@localhost.localdomain>
Date: Mon, 15 May 2017 22:55:45 +0900
Subject: [PATCH] Format source codes

---
 src/expr.rs         | 16 +++++++--------
 src/issues.rs       | 49 ++++++++++++++++++++++-----------------------
 src/items.rs        |  2 +-
 src/macros.rs       | 14 ++++++-------
 src/missed_spans.rs | 12 +++++------
 src/types.rs        |  2 +-
 src/visitor.rs      |  4 ++--
 7 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/src/expr.rs b/src/expr.rs
index 729a98170af..7fb71c2e8b4 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1961,14 +1961,14 @@ pub fn rewrite_tuple<'a, I>(context: &RewriteContext,
         // 3 = "(" + ",)"
         let nested_shape = try_opt!(shape.sub_width(3)).visual_indent(1);
         return items
-                   .next()
-                   .unwrap()
-                   .rewrite(context, nested_shape)
-                   .map(|s| if context.config.spaces_within_parens {
-                            format!("( {}, )", s)
-                        } else {
-                            format!("({},)", s)
-                        });
+            .next()
+            .unwrap()
+            .rewrite(context, nested_shape)
+            .map(|s| if context.config.spaces_within_parens {
+                     format!("( {}, )", s)
+                 } else {
+                     format!("({},)", s)
+                 });
     }
 
     let list_lo = context.codemap.span_after(span, "(");
diff --git a/src/issues.rs b/src/issues.rs
index 4819816c4eb..6e58784c1b8 100644
--- a/src/issues.rs
+++ b/src/issues.rs
@@ -131,16 +131,16 @@ impl BadIssueSeeker {
             todo_idx += 1;
             if todo_idx == TO_DO_CHARS.len() {
                 return Seeking::Number {
-                           issue: Issue {
-                               issue_type: IssueType::Todo,
-                               missing_number: if let ReportTactic::Unnumbered = self.report_todo {
-                                   true
-                               } else {
-                                   false
-                               },
-                           },
-                           part: NumberPart::OpenParen,
-                       };
+                    issue: Issue {
+                        issue_type: IssueType::Todo,
+                        missing_number: if let ReportTactic::Unnumbered = self.report_todo {
+                            true
+                        } else {
+                            false
+                        },
+                    },
+                    part: NumberPart::OpenParen,
+                };
             }
             fixme_idx = 0;
         } else if self.report_fixme.is_enabled() && c == FIX_ME_CHARS[fixme_idx] {
@@ -149,17 +149,16 @@ impl BadIssueSeeker {
             fixme_idx += 1;
             if fixme_idx == FIX_ME_CHARS.len() {
                 return Seeking::Number {
-                           issue: Issue {
-                               issue_type: IssueType::Fixme,
-                               missing_number: if let ReportTactic::Unnumbered =
-                    self.report_fixme {
-                                   true
-                               } else {
-                                   false
-                               },
-                           },
-                           part: NumberPart::OpenParen,
-                       };
+                    issue: Issue {
+                        issue_type: IssueType::Fixme,
+                        missing_number: if let ReportTactic::Unnumbered = self.report_fixme {
+                            true
+                        } else {
+                            false
+                        },
+                    },
+                    part: NumberPart::OpenParen,
+                };
             }
             todo_idx = 0;
         } else {
@@ -182,10 +181,10 @@ impl BadIssueSeeker {
             return IssueClassification::Bad(issue);
         } else if c == ')' {
             return if let NumberPart::CloseParen = part {
-                       IssueClassification::Good
-                   } else {
-                       IssueClassification::Bad(issue)
-                   };
+                IssueClassification::Good
+            } else {
+                IssueClassification::Bad(issue)
+            };
         }
 
         match part {
diff --git a/src/items.rs b/src/items.rs
index a99797579c3..5eb1414c2e0 100644
--- a/src/items.rs
+++ b/src/items.rs
@@ -1104,7 +1104,7 @@ fn format_tuple_struct(context: &RewriteContext,
         // know that earlier, so the where clause will not be indented properly.
         result.push('\n');
         result.push_str(&(offset.block_only() + (context.config.tab_spaces - 1))
-                             .to_string(context.config));
+                            .to_string(context.config));
     }
     result.push_str(&where_clause_str);
 
diff --git a/src/macros.rs b/src/macros.rs
index d644e32bb6d..8f998e42035 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -94,13 +94,13 @@ pub fn rewrite_macro(mac: &ast::Mac,
 
     if mac.node.tts.is_empty() && !contains_comment(&context.snippet(mac.span)) {
         return match style {
-                   MacroStyle::Parens if position == MacroPosition::Item => {
-                       Some(format!("{}();", macro_name))
-                   }
-                   MacroStyle::Parens => Some(format!("{}()", macro_name)),
-                   MacroStyle::Brackets => Some(format!("{}[]", macro_name)),
-                   MacroStyle::Braces => Some(format!("{}{{}}", macro_name)),
-               };
+            MacroStyle::Parens if position == MacroPosition::Item => {
+                Some(format!("{}();", macro_name))
+            }
+            MacroStyle::Parens => Some(format!("{}()", macro_name)),
+            MacroStyle::Brackets => Some(format!("{}[]", macro_name)),
+            MacroStyle::Braces => Some(format!("{}{{}}", macro_name)),
+        };
     }
 
     let mut parser = tts_to_parser(context.parse_session, mac.node.tts.clone());
diff --git a/src/missed_spans.rs b/src/missed_spans.rs
index aef158199ba..843556b9b38 100644
--- a/src/missed_spans.rs
+++ b/src/missed_spans.rs
@@ -138,8 +138,8 @@ impl<'a> FmtVisitor<'a> {
 
                 if rewrite_next_comment &&
                    !self.config
-                        .file_lines
-                        .intersects_range(file_name, cur_line, cur_line + subslice_num_lines) {
+                       .file_lines
+                       .intersects_range(file_name, cur_line, cur_line + subslice_num_lines) {
                     rewrite_next_comment = false;
                 }
 
@@ -164,7 +164,7 @@ impl<'a> FmtVisitor<'a> {
                                                    Shape::legacy(comment_width,
                                                                  self.block_indent),
                                                    self.config)
-                                           .unwrap());
+                                          .unwrap());
 
                     last_wspace = None;
                     line_start = offset + subslice.len();
@@ -172,9 +172,9 @@ impl<'a> FmtVisitor<'a> {
                     if let Some('/') = subslice.chars().skip(1).next() {
                         // check that there are no contained block comments
                         if !subslice
-                                .split('\n')
-                                .map(|s| s.trim_left())
-                                .any(|s| s.len() > 2 && &s[0..2] == "/*") {
+                               .split('\n')
+                               .map(|s| s.trim_left())
+                               .any(|s| s.len() > 2 && &s[0..2] == "/*") {
                             // Add a newline after line comments
                             self.buffer.push_str("\n");
                         }
diff --git a/src/types.rs b/src/types.rs
index e2a95c66832..754db673013 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -595,7 +595,7 @@ impl Rewrite for ast::Ty {
                     Mutability::Immutable => "*const ",
                 };
 
-                rewrite_unary_prefix(context, prefix, &*mt.ty, shape, self.span)
+                rewrite_unary_prefix(context, prefix, &*mt.ty, shape)
             }
             ast::TyKind::Rptr(ref lifetime, ref mt) => {
                 let mut_str = format_mutability(mt.mutbl);
diff --git a/src/visitor.rs b/src/visitor.rs
index e813f3a1813..556b9912697 100644
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -50,8 +50,8 @@ impl<'a> FmtVisitor<'a> {
 
         // FIXME(#434): Move this check to somewhere more central, eg Rewrite.
         if !self.config
-                .file_lines
-                .intersects(&self.codemap.lookup_line_range(stmt.span)) {
+               .file_lines
+               .intersects(&self.codemap.lookup_line_range(stmt.span)) {
             return;
         }