Skip to content

Commit a9265ae

Browse files
committed
Format source codes
1 parent d4320c2 commit a9265ae

File tree

8 files changed

+34
-15
lines changed

8 files changed

+34
-15
lines changed

src/file_lines.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ impl FileLines {
167167
}
168168

169169
/// FileLines files iterator.
170-
pub struct Files<'a>(Option<::std::collections::hash_map::Keys<'a, String, Vec<Range>>>);
170+
pub struct Files<'a>(
171+
Option<::std::collections::hash_map::Keys<'a, String, Vec<Range>>>,
172+
);
171173

172174
impl<'a> iter::Iterator for Files<'a> {
173175
type Item = &'a String;

tests/target/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn main() {
2929
kaas!(
3030
// comments
3131
a, // post macro
32-
b /* another */
32+
b // another
3333
);
3434

3535
trailingcomma!(a, b, c,);

tests/target/multiple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ where
4040

4141
fn baz<
4242
'a: 'b, // comment on 'a
43-
T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType, /* comment on T */
43+
T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType, // comment on T
4444
>(
4545
a: A,
4646
b: B, // comment on b

tests/target/paths.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ fn main() {
1414
supports_clipboard,
1515
);
1616

17-
Quux::<ParamOne /* Comment 1 */, ParamTwo /* Comment 2 */>::some_func();
17+
Quux::<
18+
ParamOne, // Comment 1
19+
ParamTwo, // Comment 2
20+
>::some_func();
1821

1922
<*mut JSObject>::relocate(entry);
2023

tests/target/struct_lits.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ fn issue491() {
141141
arm: 0, // Comment
142142
};
143143

144-
Foo { arm: 0 /* Comment */ };
144+
Foo {
145+
arm: 0, // Comment
146+
};
145147

146148
Foo {
147149
a: aaaaaaaaaa,

tests/target/struct_tuple_visual.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn foo() {
1010
// Comment
1111
foo(), // Comment
1212
// Comment
13-
bar(), /* Comment */
13+
bar(), // Comment
1414
);
1515

1616
Foo(Bar, f());
@@ -24,7 +24,7 @@ fn foo() {
2424

2525
Baz(
2626
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
27-
zzzzz, /* test */
27+
zzzzz, // test
2828
);
2929

3030
A(

tests/target/structs.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ struct Bar;
4242

4343
struct NewType(Type, OtherType);
4444

45-
struct NewInt<T: Copy>(pub i32, SomeType /* inline comment */, T /* sup */);
45+
struct NewInt<T: Copy>(
46+
pub i32,
47+
SomeType, // inline comment
48+
T, // sup
49+
);
4650

4751
struct Qux<
4852
'a,
@@ -109,7 +113,10 @@ struct Baz {
109113
}
110114

111115
// Will this be a one-liner?
112-
struct Tuple(A /* Comment */, B);
116+
struct Tuple(
117+
A, // Comment
118+
B,
119+
);
113120

114121
pub struct State<F: FnMut() -> time::Timespec> {
115122
now: F,
@@ -158,10 +165,18 @@ struct Foo<T>(
158165
TTTTTTTTTTTTTTTTTTT,
159166
UUUUUUUUUUUUUUUUUUU,
160167
);
161-
struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT)
168+
struct Foo<T>(
169+
TTTTTTTTTTTTTTTTTT,
170+
UUUUUUUUUUUUUUUUUUUUUUUU,
171+
TTTTTTTTTTTTTTTTTTT,
172+
)
162173
where
163174
T: PartialEq;
164-
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT)
175+
struct Foo<T>(
176+
TTTTTTTTTTTTTTTTT,
177+
UUUUUUUUUUUUUUUUUUUUUUUU,
178+
TTTTTTTTTTTTTTTTTTTTT,
179+
)
165180
where
166181
T: PartialEq;
167182
struct Foo<T>(

tests/target/trailing_commas.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ struct Pair<
4848

4949
struct TupPair<
5050
S, T,
51-
>(
52-
S,
53-
T,
54-
)
51+
>(S, T,)
5552
where
5653
T: P,
5754
S: P + Q;

0 commit comments

Comments
 (0)