Put opening paren next to multi line generic

This commit is contained in:
Seiichi Uchida 2017-06-03 23:16:29 +09:00
parent 5650411d64
commit d21792a730
3 changed files with 6 additions and 5 deletions

View File

@ -1587,7 +1587,10 @@ fn rewrite_fn_base(context: &RewriteContext,
let generics_str = try_opt!(rewrite_generics(context, generics, shape, generics_span)); let generics_str = try_opt!(rewrite_generics(context, generics, shape, generics_span));
result.push_str(&generics_str); result.push_str(&generics_str);
let snuggle_angle_bracket = last_line_width(&generics_str) == 1; let snuggle_angle_bracket = generics_str
.lines()
.last()
.map_or(false, |l| l.trim_left().len() == 1);
// Note that the width and indent don't really matter, we'll re-layout the // Note that the width and indent don't really matter, we'll re-layout the
// return type later anyway. // return type later anyway.

View File

@ -52,8 +52,7 @@ impl Foo {
'a: 'bbbbbbbbbbbbbbbbbbbbbbbbbbb, 'a: 'bbbbbbbbbbbbbbbbbbbbbbbbbbb,
TTTTTTTTTTTTT, TTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUU: WWWWWWWWWWWWWWWWWWWWWWWW UUUUUUUUUUUUUUUUUUUU: WWWWWWWWWWWWWWWWWWWWWWWW
> >(
(
a: Aaaaaaaaaaaaaaa, a: Aaaaaaaaaaaaaaa,
) { ) {
bar(); bar();

View File

@ -54,8 +54,7 @@ impl Foo {
'a: 'bbbbbbbbbbbbbbbbbbbbbbbbbbb, 'a: 'bbbbbbbbbbbbbbbbbbbbbbbbbbb,
TTTTTTTTTTTTT, TTTTTTTTTTTTT,
UUUUUUUUUUUUUUUUUUUU: WWWWWWWWWWWWWWWWWWWWWWWW UUUUUUUUUUUUUUUUUUUU: WWWWWWWWWWWWWWWWWWWWWWWW
> >(
(
a: Aaaaaaaaaaaaaaa, a: Aaaaaaaaaaaaaaa,
) { ) {
bar(); bar();