]> git.lizzy.rs Git - rust.git/commitdiff
Insert newline between type alias with where clause
authorSeiichi Uchida <seuchida@gmail.com>
Wed, 2 Aug 2017 14:27:33 +0000 (23:27 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Wed, 2 Aug 2017 14:27:33 +0000 (23:27 +0900)
src/items.rs

index 7b2c016aed077ca4c6c8656e2aac1917f0988a3d..dc40d1b5b8a116ef31e1894a544bc908c59662a4 100644 (file)
@@ -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