topecongiro
fe69dde96b
Replace 'try_opt!' macro with a '?' operator
2017-10-05 20:50:19 +09:00
topecongiro
436a083fce
Change return type of rewrite_call_inner() to Option<String>
2017-09-28 16:33:30 +09:00
Seiichi Uchida
df7d2be562
Move Indent and Shape to shape.rs from lib.rs
2017-09-19 10:04:35 +09: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
topecongiro
f0580ae91a
Use Cow to avoid unnecessary allocation
2017-09-15 18:21:06 +09:00
topecongiro
0b3b89d51f
Remove unnecessary return
2017-09-15 17:09:45 +09:00
topecongiro
f51261e93e
Cargo fmt
2017-09-15 12:10:58 +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
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
343b315830
Handle macros with tabs
2017-08-27 13:44:49 +09:00
topecongiro
24efc3a934
Ignore empty lines inside arguments of macro with brace
2017-08-25 22:35:22 +09:00
Seiichi Uchida
a18a40cbc1
Add indent to macro we could not format
2017-08-21 23:19:01 +09:00
topecongiro
840edb2c4f
Remove 'mut' notation
2017-08-11 17:54:38 +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
topecongiro
60f0c576c9
Preserve trailing comma of macro invocation
2017-06-23 12:59:47 +09:00
topecongiro
54233acc8e
Format source codes
2017-06-17 16:56:54 +09:00
topecongiro
4a5871eccc
Use correct indentaion for vec! with semicolon
2017-06-16 13:57:37 +09:00
topecongiro
8955eb86e6
Direct format vec! instead of using rewrite_pair
2017-06-14 20:33:54 +09: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
a9f529cba4
Format source codes
2017-06-04 19:35:29 +09:00
Seiichi Uchida
10c3632078
Format source codes
2017-06-01 12:08:25 +09:00
topecongiro
86856491bc
Format source codes
2017-05-25 16:08:08 +09:00
Nick Cameron
393ba27311
Remove dependency on Itertools
2017-05-25 16:23:07 +12:00
Nick Cameron
93c556c6ba
Merge pull request #1578 from topecongiro/poor/macro
...
Use original code snippet for macro which contains invalid syntax
2017-05-24 11:43:10 +12:00
topecongiro
e3eec44690
Return original snippet when macro contains invalid syntax
2017-05-24 07:24:31 +09:00
topecongiro
04bb5d8929
Format source codes
2017-05-24 00:07:02 +09:00
topecongiro
13af774e55
Fix weird indentaion in chain
2017-05-23 11:37:12 +09:00
topecongiro
d16a0a399e
Implement 'vec![expr; expr]'
2017-05-23 11:32:09 +09:00
Michael Killough
c3c2e823cb
Merge branch 'master' of https://github.com/rust-lang-nursery/rustfmt into config
2017-05-18 13:05:19 +07:00
topecongiro
d7b6f1199f
Format source codes
2017-05-16 23:24:38 +09:00
Michael Killough
c0bdbfa531
Switch to accessing config items via method.
...
Preparation for #865 , which proposes adding a flag which outputs which
config options are used during formatting.
This PR should not make any difference to functionality. A lot of this
was search-and-replace.
Some areas worthy of review/discussion:
- The method for each config item returns a clone of the underlying
value. We can't simply return an immutable reference, as lots of
places in the code expect to be able to pass the returned value as
`bool` (not `&bool). It would be nice if the `bool` items could
return a copy, but the more complex types a borrowed reference... but
unfortunately, I couldn't get the macro to do this.
- A few places (mostly tests and `src/bin/rustfmt.rs`) were overriding
config items by modifying the fields of the `Config` struct directly.
They now use the existing `override_value()` method, which has been
modified to return a `Result` for use by `src/bin/rustfmt.rs`. This
benefits of this are that the complex `file_lines` and `write_mode`
strings are now parsed in one place (`Config.override_value`) instead
of multiple. The disadvantages are that it moves the compile-time
checks for config names to become run-time checks.
2017-05-16 15:47:09 +07:00
Seiichi Uchida
762db5138e
Format source codes
2017-05-15 22:55:45 +09:00
Seiichi Uchida
7ec78711f2
Prevent rewriting closure block to expr inside macro
2017-05-13 18:32:25 +09:00
Nick Cameron
c546f1b396
Merge pull request #1454 from topecongiro/match
...
Format nested mathces properly.
2017-05-02 10:40:31 +12:00
topecongiro
02cf515be6
Format source codes
2017-04-24 16:50:11 +09:00
topecongiro
02c9ac93be
Prohibit long return val from 'rewrite_closure_block'
2017-04-17 23:17:17 +09:00
Ryan1729
4c4f70957b
fix bug by adding boolean argument
...
Signed-off-by: Ryan1729 <Ryan1729@gmail.com>
2017-04-03 17:39:14 -06:00
Nick Cameron
5305bc8436
test fallout
2017-03-28 11:25:59 +13:00
Nick Cameron
5fb1140688
fallout - source reformatting
2017-03-28 11:14:47 +13:00
Nick Cameron
e4efa22983
Source formatting fallout
2017-03-28 10:58:41 +13:00
Nick Cameron
9eb78a3333
Fallout
2017-02-23 13:15:48 +13:00
Nick Cameron
b35906dbce
WIP
2017-02-21 16:35:05 +13:00
Nick Cameron
428339fdc3
Refactor indent and width into Shape struct
2017-01-31 08:35:23 +13:00
Erick Tryzelaar
e67ffcfb21
Update to the latest syntex module
...
One notable feature is this this adds support for the experimental
`let x = loop { ... break $expr; }` syntax. This also includes a
test for formatting all the break and continue variations.
2016-12-23 11:20:07 -08:00
Nick Cameron
d3eba76e4d
update Serde, etc.
...
Lots of changes to how closures work
2016-11-21 11:02:18 +13:00
Bekh-Ivanov Aleksey
935286755c
Stripping trailing commas and spaces from vec!
elements ( #1219 )
...
* Stripping trailing commas and spaces from `vec!` elements
* Stripping trailing commas and spaces ONLY from `vec!` elements
* Added comment
2016-11-14 17:42:15 +13:00