Skip to content

Commit b31cfdc

Browse files
committed
fix test
1 parent 67f681f commit b31cfdc

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

src/expr.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,7 @@ fn to_control_flow(expr: &ast::Expr, expr_type: ExprType) -> Option<ControlFlow>
797797
}
798798

799799
fn choose_matcher(pats: &[&ast::Pat]) -> &'static str {
800-
if pats.is_empty() {
801-
""
802-
} else {
803-
"let"
804-
}
800+
if pats.is_empty() { "" } else { "let" }
805801
}
806802

807803
impl<'a> ControlFlow<'a> {

tests/target/expr.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,9 @@ fn foo() -> bool {
2626
+ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
2727
+ aaaaa);
2828

29-
{
30-
for _ in 0..10 {}
31-
}
29+
{ for _ in 0..10 {} }
3230

33-
{
34-
{
35-
{
36-
{}
37-
}
38-
}
39-
}
31+
{ { { {} } } }
4032

4133
if 1 + 2 > 0 {
4234
let result = 5;

tests/target/fn-single-line.rs

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
// rustfmt-fn_single_line: true
22
// Test single-line functions.
33

4-
fn foo_expr() { 1 }
4+
fn foo_expr() {
5+
1
6+
}
57

6-
fn foo_stmt() { foo(); }
8+
fn foo_stmt() {
9+
foo();
10+
}
711

8-
fn foo_decl_local() { let z = 5; }
12+
fn foo_decl_local() {
13+
let z = 5;
14+
}
915

10-
fn foo_decl_item(x: &mut i32) { x = 3; }
16+
fn foo_decl_item(x: &mut i32) {
17+
x = 3;
18+
}
1119

1220
fn empty() {}
1321

14-
fn foo_return() -> String { "yay" }
22+
fn foo_return() -> String {
23+
"yay"
24+
}
1525

1626
fn foo_where() -> T
1727
where
@@ -21,9 +31,7 @@ where
2131
}
2232

2333
fn fooblock() {
24-
{
25-
"inner-block"
26-
}
34+
{ "inner-block" }
2735
}
2836

2937
fn fooblock2(x: i32) {
@@ -51,9 +59,13 @@ fn aaaaaaaaaaaaaaaaa_looooooooooooooooooooooong_name() {
5159
let z = "aaaaaaawwwwwwwwwwwwwwwwwwwwwwwwwwww";
5260
}
5361

54-
fn lots_of_space() { 1 }
62+
fn lots_of_space() {
63+
1
64+
}
5565

56-
fn mac() -> Vec<i32> { vec![] }
66+
fn mac() -> Vec<i32> {
67+
vec![]
68+
}
5769

5870
trait CoolTypes {
5971
fn dummy(&self) {}

0 commit comments

Comments
 (0)