Caleb Cartwright
f99e3582bd
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
2021-11-07 20:37:34 -06:00
Caleb Cartwright
2b41b6d022
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtree
2021-10-20 00:11:59 -05:00
Caleb Cartwright
e4b8714c09
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt
2021-07-25 22:57:19 -05:00
Caleb Cartwright
1bcc1f8df5
refactor: apply heuristic config changes in lib
2021-04-21 21:27:50 -05:00
Caleb Cartwright
bd5dff4012
refactor: backport syntux mod
2020-03-26 21:25:34 -05:00
Caleb Cartwright
c60416ed21
deps: update rustc-ap to v642.0.0
2020-02-08 22:21:37 -06:00
Caleb Cartwright
6dcbc5d78e
fix: handle block comments with trailing line comments ( #3842 )
2019-10-08 10:12:21 +09:00
rChaser53
71289e1d23
fix 'extra comma inserted due to comment' ( #3677 )
2019-07-14 22:16:47 +09:00
Stéphane Campinas
84c2356590
handle unicode chars in closures ( #3632 )
...
The `NotUnicode` branch was unecessarily put on a new line, although it
was within max width:
```diff
fn baz() {
let our_error_b = result_b_from_func.or_else(|e| match e {
NotPresent => Err(e).chain_err(|| "env var wasn't provided"),
- NotUnicode(_) => Err(e).chain_err(|| "env var was very very very borkæ–‡å—化ã"),
+ NotUnicode(_) => {
+ Err(e).chain_err(|| "env var was very very very borkæ–‡å—化ã")
+ }
});
}
```
2019-06-17 08:53:17 +09:00
Stéphane Campinas
e6b60a40d5
stabilise fn_args_density ( #3581 )
2019-06-03 22:26:48 +09:00
Ruben Schmidmeister
618d092bf7
Enable unreachable_pub lint
2019-05-09 20:37:51 +02:00
rchaser53
2c58b205d5
fix Comma in comment causes no formatting
2019-04-29 21:38:38 +09:00
Matthias Krüger
4352681d62
fix clippy warnings
...
clippy::needless_return
clippy::redundant_closure
clippy::or_fun_call
clippy::len_zero
clippy::expect_fun_call
clippy::assertions_on_constants
clippy::identity_conversion
clippy::chars_last_cmp
2019-04-11 13:48:13 +02:00
Seiichi Uchida
dfa94d1505
Merge pull request #3480 from sinkuu/cleanup
...
Cleanups
2019-03-29 22:07:19 +09:00
Shotaro Yamada
c0ff894a22
Fix indexing panic on unicode whitespaces
2019-03-29 20:12:45 +09:00
Shotaro Yamada
ff0683d666
Simplify iterators
2019-03-29 19:06:32 +09:00
rchaser53
f0c861bfa9
implement for const generics
2019-03-13 03:58:23 +09:00
rchaser53
dec3902076
leave post comment for self
2019-03-02 17:33:43 +09:00
Alexander Regueiro
7a3b7c9275
Various cosmetic improvements ( #3403 )
2019-02-19 11:56:42 +09:00
Hirokazu Hata
4bb90f5cc8
Fix rust_2018_idioms warnings
2019-02-09 16:14:30 +09:00
Evgenii
ece629b1cc
transition to Rust 2018
2019-02-04 13:30:43 +03:00
Philipp Hansch
d0785954c8
Fix trim_right/trim_left deprecation warnings ( #3252 )
2018-12-18 11:21:31 +09:00
Nick Cameron
dd7add784b
Don't align comments on extern crate
s
...
Closes #3128
2018-11-15 21:38:01 +13:00
Matthias Krüger
8c996331cc
fix a couple of clippy lint warnings
...
simplify a comparison with "true"
fn can_be_overflowed: remove unused lifetime
fn rewrite_pairs_one_line: pass "list" by reference (it is not consumed in the function)
fn span_for_token_stream: pass "token_stream" by reference since it is not consumed
use tool lints for clippy suppressions
2018-10-19 01:11:28 +02:00
Nick Cameron
c09d7ef088
Merge pull request #3106 from sinkuu/clippy
...
Clippy and cleanups
2018-10-16 09:09:56 +13:00
Shotaro Yamada
751bcf5fa0
Clippy
2018-10-15 23:59:08 +09:00
Nick Cameron
cbd568083d
Fixup formatting
2018-10-15 11:52:27 +13:00
Emilio Cobos Álvarez
66c15e46ba
lists: Detect block comment by starting from the end.
...
The issue with the current code is that comments are collapsed, so comments like
the one from the test end up in a string like:
```
"// this is a single line comment\n/* block = */"
```
I chose to fix it by detecting whether we're in a block comment starting from
the end instead, and tested a single-line comment ended in `*/` just for sanity,
ensuring line breaks are not removed in that case, which would break the
formatting.
The right fix eventually is probably to lex the comments properly, but this does
the work for now, I guess :)
Fixes #3025
2018-09-22 12:16:38 +02:00
Maximilian Roos
968affc3e0
final clippy changes
2018-09-01 16:32:38 -04:00
Maximilian Roos
df72570b58
set of clippy changes
2018-08-28 00:33:51 -04:00
cad97
04d804c365
Rename CodeMap/FileMap to SourceMap/SourceFile
...
#2946
2018-08-23 17:10:46 -04:00
Nick Cameron
66d3924aa8
Merge pull request #2899 from topecongiro/chain-with-comments
...
Format chains with comment
2018-08-07 15:07:23 +12:00
Seiichi Uchida
24fccdc45c
Factor out functions that extract comments around items
2018-08-05 19:55:03 +09:00
Seiichi Uchida
1a6df18d6f
Remove pub(self)
2018-08-04 08:47:48 +09:00
Seiichi Uchida
024c03e81b
Use builder pattern for ListFormatting
2018-08-03 22:13:20 +09:00
Nick Cameron
b28a0cd6e6
Fix an anomaly with comments and array literals
...
Closes #2842
2018-07-17 15:40:19 +12:00
Nick Cameron
229a55248b
address reviewer comments
2018-07-12 22:21:07 +12:00
Nick Cameron
486f8fd8e7
Fixup formatting of tests and source
2018-07-12 21:37:28 +12:00
Nick Cameron
42f03458dd
Refactor and fixup attribute formatting
...
Preserves trailing commas (except in derives where we follow function args).
Correctly uses `#` vs `#!` for derives.
Uses block indent for derives, fixes #2805 .
2018-06-26 15:18:17 +12:00
Nick Cameron
87edd75ecf
TODO -> FIXME
...
Or just delete
Closes #25
2018-06-22 14:42:27 +12:00
Josh Chase
ee5ff2d9e8
Add flag to the ListFormatting struct for nested imports
2018-06-19 12:13:35 -04:00
Josh Chase
2077855e00
Remove NestedImport tactic
2018-06-19 12:13:26 -04:00
Seiichi Uchida
42ab258757
Put each nested import on its own line
...
while putting non-nested imports on the same line as much as possible.
2018-06-05 19:58:44 +09:00
Seiichi Uchida
b4987d848b
Allow using mixed layout with comments
2018-06-05 13:43:01 +09:00
Shotaro Yamada
d1e2b80fb9
Use saturating_sub
2018-05-15 20:41:43 +09:00
topecongiro
bd25c7d0f7
Cargo fmt
2018-05-08 06:25:48 +09:00
topecongiro
1f738ea208
Cargo fmt
2018-05-06 15:22:29 +09:00
Seiichi Uchida
ac8ae00625
Cargo update and clippy ( #2643 )
2018-04-25 07:21:23 +09:00
Nick Cameron
55dd8f1df0
Merge pull request #2603 from topecongiro/merge-nested-imports
...
Merge imports
2018-04-12 16:40:06 +12:00
Seiichi Uchida
e58e97783e
Preserve trailing comma on macro call when using mixed layout
2018-04-12 09:54:00 +09:00