From a5a7cc764342eb67702a1fbb2a8a2d573f66fe2b Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Wed, 2 Aug 2017 23:27:33 +0900 Subject: [PATCH] Insert newline between type alias with where clause --- src/items.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/items.rs b/src/items.rs index 7b2c016aed07..dc40d1b5b8a1 100644 --- a/src/items.rs +++ b/src/items.rs @@ -1313,7 +1313,11 @@ pub fn rewrite_type_alias( option, )); result.push_str(&where_clause_str); - result.push_str(" = "); + if where_clause_str.is_empty() { + result.push_str(" = "); + } else { + result.push_str(&format!("\n{}= ", indent.to_string(context.config))); + } let line_width = last_line_width(&result); // This checked_sub may fail as the extra space after '=' is not taken into account