180 Commits

Author SHA1 Message Date
topecongiro
d287b06eba Rename 'chain_one_line_max' to 'chain_width' 2017-11-04 22:24:43 +09:00
topecongiro
b17de6228f Cargo fmt 2017-11-02 21:45:00 +09:00
Martin Lindhe
f930a16b8d fix some typos 2017-11-01 07:33:55 +01:00
topecongiro
142fc45dbb Take the width of trailing '?'s into account 2017-10-18 22:23:25 +09:00
topecongiro
ad47a71012 Do not distinguish between a single-child chain from others
`last_shape` is used when rewriting the last child on its own line.
2017-10-18 22:23:25 +09:00
topecongiro
51d230ead3 Use trimmed_last_line_width() 2017-10-18 22:23:25 +09:00
Seiichi Uchida
c7250d18b1 Fix a typo 2017-10-09 22:44:00 +09:00
Seiichi Uchida
923a7bc1d9 Update doc comments in chains.rs 2017-10-07 22:45:33 +09:00
Seiichi Uchida
7359d3ad34 Simplify join_rewrites() 2017-10-07 22:45:33 +09:00
Seiichi Uchida
427b4a831d Get rid of choose_first_connector() 2017-10-07 22:45:33 +09:00
Seiichi Uchida
2b6e50436c Run wrap_str() only when chain_indent is set to "Visual" 2017-10-07 21:55:04 +09:00
Seiichi Uchida
02ef2ee8de Fix a typo 2017-10-07 21:48:45 +09:00
Seiichi Uchida
35cd72d989 Use correct budget for the last child of chain 2017-10-07 21:48:05 +09:00
topecongiro
fe69dde96b Replace 'try_opt!' macro with a '?' operator 2017-10-05 20:50:19 +09:00
Seiichi Uchida
df7d2be562 Move Indent and Shape to shape.rs from lib.rs 2017-09-19 10:04:35 +09:00
topecongiro
f51261e93e Cargo fmt 2017-09-15 12:10:58 +09:00
Seiichi Uchida
4b79055a15 Apply refactoring from cargo clippy 2017-08-31 12:49:12 +09:00
Vadim Petrochenkov
6e5c6f5ba3 Use getters to access Span fields 2017-08-31 14:14:13 +12:00
topecongiro
10f1257eb3 Use correct width for subexpr_list 2017-08-13 10:17:52 +09:00
Seiichi Uchida
04a6d16c7b Avoid trial and error in rewrite_chain whenever possible 2017-08-09 16:36:41 +09:00
Seiichi Uchida
7268a50e36 Handle prefix and suffix try operators differently 2017-08-09 16:36:41 +09:00
Seiichi Uchida
de403f4f65 Use offset_left instead of shrink_left 2017-07-20 00:41:36 +09:00
topecongiro
6fd291981e Sort imports in alphabetical and consistent order 2017-07-13 18:42:14 +09:00
topecongiro
e3310a6a18 Format source codes 2017-07-11 21:53:10 +09:00
Nick Cameron
0a42648678 Merge pull request #1775 from topecongiro/rfc/patterns
RFC: patterns in condition and match arm
2017-07-10 16:22:01 +12:00
Seiichi Uchida
bc63d69c3f Format source codes 2017-07-10 02:24:59 +09:00
Nick Cameron
7333dfc95b Merge branch 'master' of https://github.com/petrochenkov/rustfmt into petrochenkov-master 2017-07-08 11:22:53 +12:00
Vadim Petrochenkov
d4c8a17665 Update rustfmt for ast::ExprKind::MethodCall changes 2017-07-07 15:52:23 +03:00
topecongiro
cb48435ff3 Format source codes 2017-07-05 18:31:37 +09:00
topecongiro
91bd1fdc86 Format source codes 2017-06-18 14:29:17 +09:00
topecongiro
3dcd3d7fb0 Combine condition and body of control flow
If the condition of control flow expressions ends with closing parens and alike,
put the opening bracket of the body on the same line with closing parens.
2017-06-18 14:27:58 +09:00
topecongiro
54233acc8e Format source codes 2017-06-17 16:56:54 +09:00
topecongiro
92634a8f69 Use correct budget for chain 2017-06-17 16:56:37 +09:00
topecongiro
53273b8547 Try overflowing the last element of chain only if it goes multi line 2017-06-17 16:54:03 +09:00
topecongiro
b048fe6b35 Format source codes 2017-06-17 15:26:59 +09:00
topecongiro
208ff15954 Format source codes 2017-06-16 08:49:49 +09:00
topecongiro
d3d31a9f75 Allow overflowing the last item of chain only if it is multi-lined
By multi-lined we mean if it has more than 3 lines.
2017-06-16 08:47:33 +09:00
Nick Cameron
18ccd0190e Rebasing 2017-06-13 14:49:47 +12:00
Nick Cameron
1f512948a0 Reformat source code using new defaults 2017-06-13 14:41:49 +12:00
est31
727963afe4 Update syntex_syntax
Bases on commit to switch to libsyntax by @nrc
2017-06-06 07:31:47 +02:00
topecongiro
7250a468f9 Format source codes 2017-06-05 15:32:21 +09:00
topecongiro
0292640e14 Allow chain item to extend if the parent ends with closing parens and alike 2017-06-05 15:31:05 +09:00
topecongiro
b49269ad39 Forbid method chain to get combined if it uses multi line.
If the method chain goes multi line before the last element, disallow combining
the method chain.
2017-06-04 19:37:24 +09:00
topecongiro
fabbef2c3e Add macro to block expr 2017-06-04 19:35:29 +09:00
topecongiro
fef347cb9e Add use_block_indent method to RewriteContext 2017-06-04 19:35:29 +09:00
topecongiro
b63e3aaa83 Put a space between nested tuple field 2017-05-30 20:40:05 +09:00
topecongiro
554605d47c Format source codes and add tests 2017-05-26 16:40:19 +09:00
topecongiro
2580d7a310 Add chain_split_single_child option 2017-05-25 16:07:56 +09:00
topecongiro
c69608a7e0 Allow the last elem in chain to overflow 2017-05-25 15:50:46 +09:00
topecongiro
635fdc662a Format source codes 2017-05-25 15:50:46 +09:00