Commit Graph

387 Commits

Author SHA1 Message Date
Nick Cameron
39a91ba292 Fixup warnings and test formatting 2017-08-31 14:20:47 +12:00
Vadim Petrochenkov
6e5c6f5ba3 Use getters to access Span fields 2017-08-31 14:14:13 +12:00
topecongiro
979d131c5d Format and preserve attributes on ast::Stmt 2017-08-30 19:27:36 +09:00
topecongiro
e31a48b4d9 Refactoring: remove duplicates 2017-08-30 19:26:45 +09:00
Nick Cameron
7298ce9d52 Merge pull request #1925 from topecongiro/enhance-comment
Enhance comment formatting
2017-08-28 09:33:08 +12:00
topecongiro
1015dd8860 Use String::with_capacity() instead of String::new() 2017-08-28 00:24:10 +09:00
topecongiro
c4c55285da Recover comments between 'trait' and the opening brace 2017-08-28 00:17:19 +09:00
topecongiro
fa7c4d5030 Recover comments between 'impl' and the opening brace 2017-08-28 00:16:54 +09:00
topecongiro
6bbc6b54de Refactor - remove duplicates
replacing some functions with recover_missing_comments() and
rewrite_missing_comments().
2017-08-28 00:13:42 +09:00
topecongiro
ef84319e47 Fix a typo in calculating overhead for fn args 2017-08-27 14:57:21 +09:00
topecongiro
1f9e7c25c9 Implement Rewrite trait for ast::ForeignItem 2017-08-25 08:19:51 +09:00
Nick Cameron
7e171836c6 Merge pull request #1900 from spinda/attributes-on-same-line
Add attributes_on_same_line_as_{field,variant} configs
2017-08-21 11:26:36 +12:00
Nick Cameron
88cb142173 Merge pull request #1895 from topecongiro/configs-match_pattern_separator_break_point
Add mach_pattern_separator_break_point config option
2017-08-21 09:30:34 +12:00
Michael Smith
baafa4f011
Fix wrapping of bounds in associated types
Bounds were wrapped to the full width of the line rather then the width
available after the "type ...: ", resulting in rustfmt unnecessarily producing
lines that were longer than the maximum width.
2017-08-19 15:30:53 -07:00
Michael Smith
1c9d044c05
Add attributes_on_same_line_as_{field,variant} 2017-08-19 15:09:10 -07:00
Seiichi Uchida
63ac49638b Support match_pattern_separator_break_point config option 2017-08-18 23:19:47 +09:00
topecongiro
a4e0fe2b02 Allow attributes to stay on the same line with fields 2017-08-11 17:52:49 +09:00
topecongiro
0bb998685d Cover comments between function args and the brace 2017-08-10 23:11:18 +09:00
topecongiro
be38606c77 Add leave_last field to ListItems 2017-08-09 16:37:21 +09:00
Seiichi Uchida
a5a7cc7643 Insert newline between type alias with where clause 2017-08-02 23:27:33 +09:00
Seiichi Uchida
c0c27761b4 Simplify comments separator 2017-08-02 23:27:19 +09:00
Seiichi Uchida
d955497751 Factor out boolean flags for rewrite_where_clause() 2017-08-02 23:26:35 +09:00
Nick Cameron
9ae00a4498 Merge pull request #1847 from topecongiro/issue-1843
Implement single-line where
2017-08-02 14:28:48 +12:00
Seiichi Uchida
659d325982 Implement compressed where clause with Rfc style 2017-08-01 22:27:12 +09:00
Seiichi Uchida
ec6c2d6e99 Refactor compute_budgets_for_args() 2017-08-01 22:27:12 +09:00
Seiichi Uchida
c67f729205 Refactoring 2017-08-01 22:27:12 +09:00
topecongiro
e636fe732e Use Span from ast::WhereClause 2017-08-01 18:36:36 +09:00
Nick Cameron
c283d3e643 Merge pull request #1840 from topecongiro/match-with-max-width
Match with max width
2017-08-01 13:51:23 +12:00
Seiichi Uchida
e588f2fd7b Make definitive_tactic more generic via enum Separator 2017-07-31 16:23:42 +09:00
Seiichi Uchida
570a3505b9 Make definitive_tactic more generic with separator length 2017-07-29 22:13:23 +09:00
topecongiro
5aff5beb2a More fine-grained file-lines 2017-07-29 16:11:36 +09:00
Nick Cameron
74f5a515ef Merge pull request #1831 from topecongiro/trait-associated-type-with-default
Fix a typo in rewrite_associated_type
2017-07-29 12:31:36 +12:00
Nick Cameron
19bd5ea7b3 Merge pull request #1826 from topecongiro/issue-1824
Use correct BytePos for where when rewriting trait
2017-07-29 12:11:17 +12:00
topecongiro
462530cb7e Fix a typo in rewrite_associated_type 2017-07-28 06:27:34 +09:00
topecongiro
5a81c7d4b0 Use correct BytePos for where when rewriting trait 2017-07-27 14:21:14 +09:00
topecongiro
c3cc8fcb13 Format defaultness 2017-07-27 09:43:35 +09:00
Nick Cameron
1f991d00e0 Merge pull request #1822 from topecongiro/issue-1172
Remove newlines between list elements for expressions
2017-07-27 11:15:53 +12:00
Seiichi Uchida
261865ecc9 Remove newlines between list elements for expressions 2017-07-26 22:43:36 +09:00
topecongiro
e523f053a3 Format source codes and update tests 2017-07-26 16:30:58 +09:00
Nick Cameron
8b5831b501 Merge pull request #1818 from topecongiro/issue-1194
Put braces on the next line if it exceeds max width
2017-07-26 11:40:41 +12:00
topecongiro
65ad7d3bb0 Put braces on the next line if it exceeds max width 2017-07-25 18:51:14 +09:00
topecongiro
a17993c14a Force vertical layout when struct_variant_width is 0 2017-07-25 15:19:09 +09:00
Seiichi Uchida
8b970fcc9f Format inner attributes wherever possible 2017-07-25 00:55:55 +09:00
topecongiro
68c6fe70fd Format source codes and update tests 2017-07-21 17:57:31 +09:00
topecongiro
db5f77b7d0 Consider max_width when rewriting struct in single-line 2017-07-21 07:17:49 +09:00
Seiichi Uchida
a8b0a6e4c5 Format source codes and update tests 2017-07-20 00:42:00 +09:00
Seiichi Uchida
de403f4f65 Use offset_left instead of shrink_left 2017-07-20 00:41:36 +09:00
topecongiro
dcb953b901 Add trailing comma when using Mixed indent style with newline 2017-07-13 20:32:46 +09:00
topecongiro
6fd291981e Sort imports in alphabetical and consistent order 2017-07-13 18:42:14 +09:00
topecongiro
2fb66cd1d3 Add trailing_semicolon config option
trailing_semicolon controls whether to add a trailing semicolon after break,
continue and return.
2017-07-12 14:16:06 +09:00