From 2915167179161aa7b73a4416f638e779388bd95f Mon Sep 17 00:00:00 2001 From: topecongiro Date: Tue, 19 Sep 2017 11:41:50 +0900 Subject: [PATCH 1/1] Cargo fmt and update tests --- src/file_lines.rs | 4 +--- .../source/configs-fn_call_style-block-trailing-comma.rs | 2 +- .../target/configs-fn_call_style-block-trailing-comma.rs | 1 + tests/target/enum.rs | 8 ++------ tests/target/expr-block.rs | 4 +--- tests/target/string-lit.rs | 5 ++--- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/file_lines.rs b/src/file_lines.rs index 948ffac0731..a131038eb4e 100644 --- a/src/file_lines.rs +++ b/src/file_lines.rs @@ -167,9 +167,7 @@ pub fn intersects_range(&self, file_name: &str, lo: usize, hi: usize) -> bool { } /// `FileLines` files iterator. -pub struct Files<'a>( - Option<::std::collections::hash_map::Keys<'a, String, Vec>>, -); +pub struct Files<'a>(Option<::std::collections::hash_map::Keys<'a, String, Vec>>); impl<'a> iter::Iterator for Files<'a> { type Item = &'a String; diff --git a/tests/source/configs-fn_call_style-block-trailing-comma.rs b/tests/source/configs-fn_call_style-block-trailing-comma.rs index 6f613fb10bb..ad813f6b98a 100644 --- a/tests/source/configs-fn_call_style-block-trailing-comma.rs +++ b/tests/source/configs-fn_call_style-block-trailing-comma.rs @@ -4,5 +4,5 @@ // rustfmt should not add trailing comma when rewriting macro. See #1528. fn a() { panic!("this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:"); - foo(oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt()); + foo(a, oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt()); } diff --git a/tests/target/configs-fn_call_style-block-trailing-comma.rs b/tests/target/configs-fn_call_style-block-trailing-comma.rs index b6eb94eb677..4405f89f2af 100644 --- a/tests/target/configs-fn_call_style-block-trailing-comma.rs +++ b/tests/target/configs-fn_call_style-block-trailing-comma.rs @@ -7,6 +7,7 @@ fn a() { "this is a long string that goes past the maximum line length causing rustfmt to insert a comma here:" ); foo( + a, oooptoptoptoptptooptoptoptoptptooptoptoptoptptoptoptoptoptpt(), ); } diff --git a/tests/target/enum.rs b/tests/target/enum.rs index 393ae5232ec..d2a39b241e1 100644 --- a/tests/target/enum.rs +++ b/tests/target/enum.rs @@ -170,10 +170,6 @@ enum Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo // #1046 pub enum Entry<'a, K: 'a, V: 'a> { - Vacant( - #[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>, - ), - Occupied( - #[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>, - ), + Vacant(#[stable(feature = "rust1", since = "1.0.0")] VacantEntry<'a, K, V>), + Occupied(#[stable(feature = "rust1", since = "1.0.0")] OccupiedEntry<'a, K, V>), } diff --git a/tests/target/expr-block.rs b/tests/target/expr-block.rs index 6141ca8120e..329890e8b12 100644 --- a/tests/target/expr-block.rs +++ b/tests/target/expr-block.rs @@ -307,9 +307,7 @@ fn combine_block() { }; match x { - y => func( - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, - ), + y => func(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx), _ => func( x, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy, diff --git a/tests/target/string-lit.rs b/tests/target/string-lit.rs index fc92d379a52..e262d69b43e 100644 --- a/tests/target/string-lit.rs +++ b/tests/target/string-lit.rs @@ -25,9 +25,8 @@ fn main() -> &'static str { filename.replace(" ", "\\"); - let xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = funktion( - "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy", - ); + let xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = + funktion("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"); let unicode = "a̐éö̲\r\n"; let unicode2 = "Löwe 老虎 Léopard"; -- 2.44.0