From 9cdac82d4200dac769b37ad6c83682b4c5fbb1b1 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Fri, 23 Feb 2018 08:14:22 +0900 Subject: [PATCH] Cargo fmt and update a test --- rustfmt-bin/build.rs | 4 +++- rustfmt-core/src/types.rs | 9 +++------ .../tests/target/configs/indent_style/block_call.rs | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/rustfmt-bin/build.rs b/rustfmt-bin/build.rs index c806b1f0408..d72b44eb7f3 100644 --- a/rustfmt-bin/build.rs +++ b/rustfmt-bin/build.rs @@ -27,7 +27,9 @@ fn main() { // (git not installed or if this is not a git repository) just return an empty string. fn commit_info() -> String { match (channel(), commit_hash(), commit_date()) { - (channel, Some(hash), Some(date)) => format!("{} ({} {})", channel, hash.trim_right(), date), + (channel, Some(hash), Some(date)) => { + format!("{} ({} {})", channel, hash.trim_right(), date) + } _ => String::new(), } } diff --git a/rustfmt-core/src/types.rs b/rustfmt-core/src/types.rs index 204b5869f03..7f96a2299a3 100644 --- a/rustfmt-core/src/types.rs +++ b/rustfmt-core/src/types.rs @@ -529,12 +529,9 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option { ast::TyParamBound::TraitTyParamBound(ref tref, ast::TraitBoundModifier::None) => { tref.rewrite(context, shape) } - ast::TyParamBound::TraitTyParamBound(ref tref, ast::TraitBoundModifier::Maybe) => { - Some(format!( - "?{}", - tref.rewrite(context, shape.offset_left(1)?)? - )) - } + ast::TyParamBound::TraitTyParamBound(ref tref, ast::TraitBoundModifier::Maybe) => Some( + format!("?{}", tref.rewrite(context, shape.offset_left(1)?)?), + ), ast::TyParamBound::RegionTyParamBound(ref l) => l.rewrite(context, shape), } } diff --git a/rustfmt-core/tests/target/configs/indent_style/block_call.rs b/rustfmt-core/tests/target/configs/indent_style/block_call.rs index d3522214c2e..4e4c9465fe8 100644 --- a/rustfmt-core/tests/target/configs/indent_style/block_call.rs +++ b/rustfmt-core/tests/target/configs/indent_style/block_call.rs @@ -13,9 +13,9 @@ fn main() { "elit", ); // #1501 - let hyper = Arc::new(Client::with_connector(HttpsConnector::new( - TlsClient::new(), - ))); + let hyper = Arc::new(Client::with_connector( + HttpsConnector::new(TlsClient::new()), + )); // chain let x = yooooooooooooo -- 2.44.0