+ (type_strs, shape.indent)
+ };
+
+ let is_bound_extendable = |s: &str, b: &ast::GenericBound| match b {
+ ast::GenericBound::Outlives(..) => true,
+ ast::GenericBound::Trait(..) => last_line_extendable(s),
+ };
+ let mut result = String::with_capacity(128);
+ result.push_str(&type_strs[0]);
+ let mut can_be_put_on_the_same_line = is_bound_extendable(&result, &items[0]);
+ let generic_bounds_in_order = is_generic_bounds_in_order(items);
+ for (bound, bound_str) in items[1..].iter().zip(type_strs[1..].iter()) {
+ if generic_bounds_in_order && can_be_put_on_the_same_line {
+ result.push_str(joiner);
+ } else {
+ result.push_str(&offset.to_string_with_newline(context.config));
+ result.push_str("+ ");
+ }
+ result.push_str(bound_str);
+ can_be_put_on_the_same_line = is_bound_extendable(bound_str, bound);