]> git.lizzy.rs Git - rust.git/commitdiff
block generics in traits
authorNick Cameron <ncameron@mozilla.com>
Fri, 10 Mar 2017 03:04:08 +0000 (16:04 +1300)
committerNick Cameron <ncameron@mozilla.com>
Fri, 10 Mar 2017 03:04:08 +0000 (16:04 +1300)
src/items.rs

index 6bb30425073f2e2ec62f25b448a8ed0befaad838..768a5f5abb38a7b3b7c67eca3e82c0e4867c9fd6 100644 (file)
@@ -795,7 +795,7 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent)
                                                              where_density,
                                                              "{",
                                                              !has_body,
-                                                             false,
+                                                             trait_bound_str.is_empty() && last_line_width(&generics_str) == 1,
                                                              None));
         // If the where clause cannot fit on the same line,
         // put the where clause on a new line