ref self_ty,
ref items) = item.node {
let mut result = String::new();
+
result.push_str(&*format_visibility(&item.vis));
result.push_str(format_unsafety(unsafety));
result.push_str("impl");
result.push_str(" for ");
}
- let budget = try_opt!(context.config.max_width.checked_sub(result.len()));
+ let mut used_space = result.len();
+ if generics.where_clause.predicates.is_empty() {
+ // If there is no where clause adapt budget for type formatting to take space and curly
+ // brace into account.
+ match context.config.item_brace_style {
+ BraceStyle::AlwaysNextLine => {}
+ BraceStyle::PreferSameLine => used_space += 2,
+ BraceStyle::SameLineWhere => used_space += 2,
+ }
+ }
+
+ let budget = try_opt!(context.config.max_width.checked_sub(used_space));
let indent = offset + result.len();
result.push_str(&*try_opt!(self_ty.rewrite(context, budget, indent)));
impl<T> PartialEq for S<T> where T: PartialEq { }
}
+
+impl<BorrowType, K, V, NodeType, HandleType> Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType> {
+}
impl<T> PartialEq for S<T> where T: PartialEq {}
}
+
+impl<BorrowType, K, V, NodeType, HandleType> Handle<NodeRef<BorrowType, K, V, NodeType>,
+ HandleType> {
+}