From b78b6e8b09179adde64780a22ce5b9d4a575967f Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Thu, 20 Jul 2017 00:01:38 +0900 Subject: [PATCH] Format source codes and update tests --- src/expr.rs | 3 ++- src/visitor.rs | 5 ++++- tests/target/long-match-arms-brace-newline.rs | 5 ++++- tests/target/match.rs | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index 8aa82aa621d..1b8cfbe8c04 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1686,7 +1686,8 @@ fn rewrite_match_body( ) -> Option { let (extend, body) = match body.node { ast::ExprKind::Block(ref block) - if !is_unsafe_block(block) && is_simple_block(block, context.codemap) => { + if !is_unsafe_block(block) && is_simple_block(block, context.codemap) => + { if let ast::StmtKind::Expr(ref expr) = block.stmts[0].node { (expr.can_be_overflowed(context, 1), &**expr) } else { diff --git a/src/visitor.rs b/src/visitor.rs index 97b6ce29269..2a6a827c1a4 100644 --- a/src/visitor.rs +++ b/src/visitor.rs @@ -563,7 +563,10 @@ impl<'a> FmtVisitor<'a> { if s.rewrite( &self.get_context(), Shape::indented(self.block_indent, self.config), - ).is_none() => true, + ).is_none() => + { + true + } None => true, _ => self.failed, }; diff --git a/tests/target/long-match-arms-brace-newline.rs b/tests/target/long-match-arms-brace-newline.rs index 2a956e5b4d0..da82d971593 100644 --- a/tests/target/long-match-arms-brace-newline.rs +++ b/tests/target/long-match-arms-brace-newline.rs @@ -7,7 +7,10 @@ fn main() { match x { aaaaaaaa::Bbbbb::Ccccccccccccc(_, Some(ref x)) - if x == "aaaaaaaaaaa aaaaaaa aaaaaa" => Ok(()), + if x == "aaaaaaaaaaa aaaaaaa aaaaaa" => + { + Ok(()) + } _ => Err(x), } } diff --git a/tests/target/match.rs b/tests/target/match.rs index 433eacb7ac6..29bc8516529 100644 --- a/tests/target/match.rs +++ b/tests/target/match.rs @@ -29,7 +29,10 @@ fn foo() { } Patternnnnnnnnnnnnnnnnnnnnnnnnn | Patternnnnnnnnnnnnnnnnnnnnnnnnn - if looooooooooooooooooooooooooooooooooooooooong_guard => meh, + if looooooooooooooooooooooooooooooooooooooooong_guard => + { + meh + } // Test that earlier patterns can take the guard space (aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |