690 Commits

Author SHA1 Message Date
Seiichi Uchida
b02e813db7 Remove rewrite_call_with_binary_search() 2017-09-18 13:09:41 +09:00
Nick Cameron
d906ea23c7 Merge pull request #1968 from topecongiro/issue-1967
Reorder use items inside blocks
2017-09-18 12:59:25 +12:00
Nick Cameron
cccb7f681e Merge pull request #1966 from topecongiro/string-to-cow
Refactoring: use Cow and etc.
2017-09-18 12:45:25 +12:00
Seiichi Uchida
8e5c76094d Implement ptr_vec_to_ref_vec() 2017-09-15 22:27:20 +09:00
topecongiro
f0580ae91a Use Cow to avoid unnecessary allocation 2017-09-15 18:21:06 +09:00
topecongiro
0b5d524486 Remove unnecessary references 2017-09-15 17:09:30 +09:00
topecongiro
d55b3492c0 Rename binop_sep to binop_separator 2017-09-15 15:05:41 +09:00
topecongiro
2d21c0c30b Split after the colon of type ascription 2017-09-15 15:04:30 +09:00
topecongiro
f51261e93e Cargo fmt 2017-09-15 12:10:58 +09:00
topecongiro
45e48ec424 Add a new config option to control the placement of a binary operator 2017-09-15 12:10:30 +09:00
Nick Cameron
dc9810e242 Merge pull request #1942 from topecongiro/fixes
Some Fixes
2017-09-05 10:52:41 +12:00
topecongiro
f8bdcd62e8 Do not allow single-lined closure with block body 2017-09-03 08:10:12 +09:00
topecongiro
737186b890 Use rewrite() instead of format_expr 2017-09-03 08:09:37 +09:00
Seiichi Uchida
68da44eb97 Avoid rewriting big block twice 2017-09-01 22:52:54 +09:00
Nick Cameron
59d1e84259 Merge pull request #1937 from topecongiro/enhance-macro-rewrite
Enhance macro rewrite
2017-08-31 17:43:52 +12:00
topecongiro
848d4559e1 Enhance macro rewrite 2017-08-31 13:52:13 +09:00
Seiichi Uchida
9d49bd22f0 Add explicit lifetime 2017-08-31 13:24:32 +09:00
Seiichi Uchida
4b79055a15 Apply refactoring from cargo clippy 2017-08-31 12:49:12 +09:00
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
5280583369 Format 2017-08-30 19:27:50 +09:00
topecongiro
979d131c5d Format and preserve attributes on ast::Stmt 2017-08-30 19:27:36 +09:00
Alex Crichton
1577cefad5 Add support for Yield 2017-08-30 13:54:25 +12: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
Michael Smith
411c73c12f
Add multiline_{closure,match_arm}_forces_block
multiline_closure_forces_block = false (default):
    result.and_then(|maybe_value| match maybe_value {
        None => ...,
        Some(value) => ...,
    })

multiline_closure_forces_block = true:
    result.and_then(|maybe_value| {
        match maybe_value {
            None => ...,
            Some(value) => ...,
        }
    })

multiline_match_arm_forces_block = false (default):
    match lorem {
        None => if ipsum {
            println!("Hello World");
        },
        Some(dolor) => ...,
    }

multiline_match_arm_forces_block = true:
    match lorem {
        None => {
            if ipsum {
                println!("Hello World");
            }
        }
        Some(dolor) => ...,
    }
2017-08-21 14:05:20 -07: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
b2d10e39b4
Fix typos in comment 2017-08-18 17:11:35 -07:00
Seiichi Uchida
63ac49638b Support match_pattern_separator_break_point config option 2017-08-18 23:19:47 +09:00
Seiichi Uchida
f9d279576f Use write_list() for rewriting match arms 2017-08-18 23:15:56 +09:00
Nick Cameron
02cb9a134d Merge pull request #1886 from topecongiro/issue-1882
Obey to `array_layout` when using mixed tactic for array
2017-08-16 16:27:37 +12:00
Seiichi Uchida
4fd9920a2d Obey to array_layout when using mixed tactic for array 2017-08-15 22:10:39 +09:00
Seiichi Uchida
a1d28bf41c Merge pull request #1872 from sinkuu/remove_newline
Remove blank lines at start or end of block
2017-08-15 00:28:31 +09:00
topecongiro
0af19985fc Generalize combine_attr_and_expr 2017-08-11 17:52:13 +09:00
sinkuu
fea3080f91 Format 2017-08-11 17:44:16 +09:00
topecongiro
beeaf8d065 Fix a typo 2017-08-09 16:37:21 +09:00
topecongiro
bb8afcb091 Avoid rewriting the last argument whenever possible 2017-08-09 16:37:21 +09:00
topecongiro
be38606c77 Add leave_last field to ListItems 2017-08-09 16:37:21 +09:00
Seiichi Uchida
f9239dd630 Format source codes and update tests 2017-08-09 16:36:41 +09:00
topecongiro
6b85c4a6e7 Format inner attributes in match expr 2017-08-05 15:24:12 +09:00
topecongiro
d4bf413956 Do not add missing snippet between arms if it's just spaces 2017-08-05 15:23:23 +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
568a9adf87 Avoid early line breaks in match condition 2017-07-31 16:24:07 +09: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
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
38614e7af1 Format source codes and update tests 2017-07-26 17:43:17 +09:00
topecongiro
6b8f62fcc8 Avoid regression 2017-07-26 17:42:52 +09:00
topecongiro
760d6b85e2 Ignore the last line overhead when rewriting condition 2017-07-26 17:41:45 +09:00