if try_opt!(is_impl_single_line(context, &items, &result, &where_clause_str, &item)) {
result.push_str(&where_clause_str);
if where_clause_str.contains('\n') {
- result.push_str("\n{\n}");
+ let white_space = offset.to_string(context.config);
+ result.push_str(&format!("\n{}{{\n{}}}", &white_space, &white_space));
} else {
result.push_str(" {}");
}
BraceStyle::PreferSameLine => result.push(' '),
BraceStyle::SameLineWhere => {
if !where_clause_str.is_empty() {
- result.push('\n')
+ result.push('\n');
+ result.push_str(&offset.to_string(context.config));
} else {
- result.push(' ')
+ result.push(' ');
}
}
}
}
pub impl<T, Z> Foo for Bar<T, Z> where T: Foo, Z: Baz {}
+
+mod m {
+ impl<T> PartialEq for S<T> where T: PartialEq {
+ fn eq(&self, other: &Self) {
+ true
+ }
+ }
+
+ impl<T> PartialEq for S<T> where T: PartialEq { }
+ }
Z: Baz
{
}
+
+mod m {
+ impl<T> PartialEq for S<T>
+ where T: PartialEq
+ {
+ fn eq(&self, other: &Self) {
+ true
+ }
+ }
+
+ impl<T> PartialEq for S<T> where T: PartialEq {}
+}