Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding where_single_line option (#2030)
* feat(where): adding where_single_line option and tests * fix(where): adding more tests * feat(where): changing the shape of where clause when where_single_line is true * feat: newline_for_brace should avoid adding a new line where where_single_line is true * fix(items): where_single_line should bypass the multi-item where clauses * fix(items): refactoring and removing redundant variables * fix(items): where_single_line should not be functional when args are multilined * fix(config): fixing conflict with upstream
- Loading branch information
Showing
4 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// rustfmt-where_single_line: true | ||
// Where style | ||
|
||
|
||
fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Lorem: Eq { | ||
// body | ||
} | ||
|
||
fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>( | ||
a: Aaaaaaaaaaaaaaa, | ||
b: Bbbbbbbbbbbbbbbb, | ||
c: Ccccccccccccccccc, | ||
d: Ddddddddddddddddddddddddd, | ||
e: Eeeeeeeeeeeeeeeeeee, | ||
) -> T | ||
where | ||
Ipsum: Eq, | ||
{ | ||
// body | ||
} | ||
|
||
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq { | ||
// body | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// rustfmt-where_single_line: true | ||
// Where style | ||
|
||
|
||
fn lorem_two_items<Ipsum, Dolor, Sit, Amet>() -> T | ||
where | ||
Ipsum: Eq, | ||
Lorem: Eq, | ||
{ | ||
// body | ||
} | ||
|
||
fn lorem_multi_line<Ipsum, Dolor, Sit, Amet>( | ||
a: Aaaaaaaaaaaaaaa, | ||
b: Bbbbbbbbbbbbbbbb, | ||
c: Ccccccccccccccccc, | ||
d: Ddddddddddddddddddddddddd, | ||
e: Eeeeeeeeeeeeeeeeeee, | ||
) -> T | ||
where | ||
Ipsum: Eq, | ||
{ | ||
// body | ||
} | ||
|
||
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T | ||
where Ipsum: Eq { | ||
// body | ||
} |