From be55f856bb3217058b28c8fd770f112aa43013eb Mon Sep 17 00:00:00 2001 From: topecongiro Date: Tue, 11 Jul 2017 21:53:48 +0900 Subject: [PATCH] Update tests --- tests/target/expr-block.rs | 32 +++++++++++++---------------- tests/target/indent_match_arms.rs | 14 ++++++------- tests/target/issue-1350.rs | 10 ++++----- tests/target/match.rs | 28 +++++++++++-------------- tests/target/nested-visual-block.rs | 12 +++++------ 5 files changed, 41 insertions(+), 55 deletions(-) diff --git a/tests/target/expr-block.rs b/tests/target/expr-block.rs index 953935baec9..5b68b374899 100644 --- a/tests/target/expr-block.rs +++ b/tests/target/expr-block.rs @@ -173,17 +173,15 @@ fn macros() { baz!(one_item_macro_which_is_also_loooooooooooooooooooooooooooooooooooooooooooooooong); let _ = match option { - None => { - baz!( - function, - like, - macro_as, - expression, - which, - is, - loooooooooooooooong - ) - } + None => baz!( + function, + like, + macro_as, + expression, + which, + is, + loooooooooooooooong + ), Some(p) => baz!(one_item_macro_as_expression_which_is_also_loooooooooooooooong), }; } @@ -318,12 +316,10 @@ fn combine_block() { y => func( xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, ), - _ => { - func( - x, - yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, - zzz, - ) - } + _ => func( + x, + yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, + zzz, + ), } } diff --git a/tests/target/indent_match_arms.rs b/tests/target/indent_match_arms.rs index 60e7b67ceb4..e0b34dbe03d 100644 --- a/tests/target/indent_match_arms.rs +++ b/tests/target/indent_match_arms.rs @@ -15,14 +15,12 @@ fn main() { 2 => "two", 3 => "three", 4 => "four", - 5 => { - match y { - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - _ => "Nope", - } - } + 5 => match y { + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + _ => "Nope", + }, _ => "something else", } diff --git a/tests/target/issue-1350.rs b/tests/target/issue-1350.rs index 1baa1985a7e..2cf65509c93 100644 --- a/tests/target/issue-1350.rs +++ b/tests/target/issue-1350.rs @@ -5,12 +5,10 @@ impl Struct { fn fun() { let result = match ::deserialize(&json) { Ok(v) => v, - Err(e) => { - match ::deserialize(&json) { - Ok(v) => return Err(Error::with_json(v)), - Err(e2) => return Err(Error::with_json(e)), - } - } + Err(e) => match ::deserialize(&json) { + Ok(v) => return Err(Error::with_json(v)), + Err(e2) => return Err(Error::with_json(e)), + }, }; } } diff --git a/tests/target/match.rs b/tests/target/match.rs index f08c5acc9be..433eacb7ac6 100644 --- a/tests/target/match.rs +++ b/tests/target/match.rs @@ -215,14 +215,12 @@ fn issue355() { wc => println!["a", b], // comment xc => vec![1, 2], // comment yc => vec![3; 4], // comment - yd => { - looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func( - aaaaaaaaaa, - bbbbbbbbbb, - cccccccccc, - dddddddddd, - ) - } + yd => looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func( + aaaaaaaaaa, + bbbbbbbbbb, + cccccccccc, + dddddddddd, + ), } } @@ -342,14 +340,12 @@ fn issue1371() { } sfEvtLostFocus => LostFocus, sfEvtGainedFocus => GainedFocus, - sfEvtTextEntered => { - TextEntered { - unicode: unsafe { - ::std::char::from_u32((*event.text.as_ref()).unicode) - .expect("Invalid unicode encountered on TextEntered event") - }, - } - } + sfEvtTextEntered => TextEntered { + unicode: unsafe { + ::std::char::from_u32((*event.text.as_ref()).unicode) + .expect("Invalid unicode encountered on TextEntered event") + }, + }, sfEvtKeyPressed => { let e = unsafe { event.key.as_ref() }; diff --git a/tests/target/nested-visual-block.rs b/tests/target/nested-visual-block.rs index 0312d6ff101..339873a3f97 100644 --- a/tests/target/nested-visual-block.rs +++ b/tests/target/nested-visual-block.rs @@ -19,13 +19,11 @@ fn main() { }, |item| { match *item { - StructLitField::Regular(ref field) => { - rewrite_field( - inner_context, - &field, - &Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent), - ) - } + StructLitField::Regular(ref field) => rewrite_field( + inner_context, + &field, + &Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent), + ), StructLitField::Base(ref expr) => { // 2 = .. expr.rewrite(