Commit Graph

514 Commits

Author SHA1 Message Date
Nick Cameron
74a957e80f
Merge pull request #2357 from topecongiro/issue-2342
Put attributes and struct fields on different line by default
2018-01-12 17:32:55 +13:00
Nick Cameron
b356fc06f7
Merge pull request #2352 from topecongiro/issue-2337
Break after colon if static item does not fit in a single line
2018-01-12 17:31:12 +13:00
Seiichi Uchida
2420d346c5 Put attributes and struct fields on different line 2018-01-11 16:57:12 +09:00
Seiichi Uchida
eaab51db2e Break after colon if static item does not fit in a single line 2018-01-10 23:23:42 +09:00
Seiichi Uchida
cb0b366b38 Cargo fmt 2018-01-10 17:17:06 +09:00
topecongiro
19d6a3c786 Put the opening brace of impl on the next line
We put the opening brace on the next line if the following conditions hold:

1. the result before '{' ends with comments or contains newline
2. the last line of the result before '{' is not extendable (i.e. consists of
   '>' and whitespaces).
2018-01-04 12:46:55 +09:00
topecongiro
c355f3854c Use correct budget when rewriting generics of trait 2018-01-04 12:46:05 +09:00
topecongiro
12ddaf93e2 Remove trim_newlines()
We call `trim_newlines()` after the `trim()`ed buffer, which is unnecessary.
2018-01-02 13:04:39 +09:00
Seiichi Uchida
f523ec58ab Do not give up rewriting struct field when attribute is long 2017-12-24 13:57:29 +09:00
Seiichi Uchida
939a6c5820 Get rid of GenericsArg wrapper type
`GenericsArg` is basically identical to `ast::GenericParam`.
Just use the latter.
2017-12-24 00:29:59 +09:00
Seiichi Uchida
1ef6bccea3 Cargo fmt
Run 'cargo fmt' with the following setting:

```
reorder_imports = true
reorder_imports_in_group = true
```
2017-12-24 00:28:58 +09:00
Bastian Köcher
fa67631b32 Fixes compilation with rust version 2017-12-21 2017-12-22 02:52:22 +01:00
topecongiro
1d8619d49a Fix wrong indentation on type alias
Use rewrite_assign_rhs() when rewriting type alias.
2017-12-21 09:58:13 +09:00
topecongiro
3a98b5a5be Format trait aliases 2017-12-15 13:47:52 +09:00
Seiichi Uchida
516f15aba1 Cargo clippy 2017-12-12 13:48:12 +09:00
Nick Cameron
fc52a4d33f
Merge pull request #2173 from topecongiro/assignment-with-100-chars
Assignment whose lhs has 100 chars
2017-12-11 17:04:41 +13:00
Nick Cameron
08022ec1a3
Merge pull request #2265 from topecongiro/issue-2262
Fix bugs related to closures
2017-12-11 09:00:56 +13:00
Seiichi Uchida
e3d2f2c2b1 Cargo fmt 2017-12-10 21:54:26 +09:00
topecongiro
5e6bb3edb0 Keep track of line number in visitor 2017-12-08 16:59:04 +09:00
Seiichi Uchida
3ebe054362 Replace into() on &str with to_owned() 2017-12-08 13:07:42 +09:00
Seiichi Uchida
c0eb8c3212 Add FmtVisitor::from_context() 2017-12-07 13:57:54 +09:00
Seiichi Uchida
7c4a84751f Convert '&str' into 'String' whenever necessary 2017-12-07 13:57:52 +09:00
Seiichi Uchida
69a15b2eee Update FmtVisitor::from_codemap() 2017-12-06 22:51:52 +09:00
Nick Cameron
b07e4339f0
Merge pull request #2221 from topecongiro/rfc/blank-lines
Keep vertical spaces between items or statements within range
2017-12-06 15:52:19 +13:00
Seiichi Uchida
026c716168 Cargo fmt 2017-12-03 11:38:16 +09:00
topecongiro
16184d3e16 Cargo fmt and update a test 2017-12-03 11:34:18 +09:00
Seiichi Uchida
89f27764ed Cargo fmt and update tests 2017-12-02 17:45:39 +09:00
Nick Cameron
076bc2332f
Merge pull request #2213 from topecongiro/issue-2212
Format defualtness on specialized impl const
2017-12-01 12:17:10 +13:00
Nick Cameron
c18ba569df
Merge pull request #1889 from topecongiro/match-arm
Do not put if on the same line as match arm
2017-12-01 11:56:01 +13:00
Oliver Schneider
ae18c6064a Run rustfmt 2017-11-30 15:04:19 +01:00
topecongiro
3b36371b78 Format defualtness on specialized impl const 2017-11-30 19:38:05 +09:00
topecongiro
22c9025027 Format source codes 2017-11-30 18:00:49 +09:00
Oliver Schneider
9667cc2484
Address clippy lints 2017-11-30 09:24:10 +01:00
topecongiro
8b53d7806c Cargo fmt 2017-11-29 17:37:51 +09:00
topecongiro
940758b1bd Cargo fmt 2017-11-27 21:00:27 +09:00
topecongiro
dff2ebba05 Remove FIXME
now is the time
2017-11-27 20:58:39 +09:00
topecongiro
5c81741733 Minor refactoring 2017-11-27 20:57:06 +09:00
topecongiro
261d325e15 Remove width of a trailing comma on variant 2017-11-27 20:54:55 +09:00
Nick Cameron
fcb48786c8
Merge pull request #2191 from topecongiro/issue-2190
Recover from failing to format variants even where there is no comment
2017-11-27 18:14:08 +13:00
topecongiro
d5c98008f0 Recover from failing to format variants even where there is no comment 2017-11-27 13:50:01 +09:00
Nick Cameron
677446e99d Merge fn_empty_single_line and impl_empty_single_line into empty_item_single_line 2017-11-27 17:46:09 +13:00
Nick Cameron
86007e7d17 Remove where_density and where_layout options
There is a choice between block and visual indent for where clauses, plus the
single line option. I think these two are too fine-grained to be useful.
2017-11-24 21:08:24 +13:00
Nick Cameron
dd1fbca99a Replace various small width heuristics with a single option
Closes #1984
2017-11-24 20:17:06 +13:00
Nick Cameron
20805acf42 Merge attributes_on_same_line_as_field and attributes_on_same_line_as_variant into same_line_attributes 2017-11-24 14:29:44 +13:00
Nick Cameron
179b3c59de Remove legacy option fn_args_paren_newline 2017-11-24 13:27:14 +13:00
Nick Cameron
4f65124422 Remove legacy option fn_return_indent 2017-11-24 13:19:36 +13:00
topecongiro
59ebde26f7 Cargo fmt 2017-11-21 08:52:43 +09:00
Nick Cameron
f987946078
Merge pull request #2161 from topecongiro/issue-1807
Implement RFC style for match pattern
2017-11-20 14:51:53 +13:00
topecongiro
d5152fc8c6 Use choose_rhs() for the layout of multi-lined struct field 2017-11-18 15:45:58 +09:00
topecongiro
35466adbfe Generalize ListItems to allow a separator other than comma 2017-11-16 17:43:36 +09:00