Skip to content

Commit 0344691

Browse files
committed
Format source codes
1 parent f8586ba commit 0344691

File tree

7 files changed

+31
-14
lines changed

7 files changed

+31
-14
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_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
@@ -41,7 +41,11 @@ struct Bar;
4141

4242
struct NewType(Type, OtherType);
4343

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

4650
struct Qux<
4751
'a,
@@ -108,7 +112,10 @@ struct Baz {
108112
}
109113

110114
// Will this be a one-liner?
111-
struct Tuple(A /* Comment */, B);
115+
struct Tuple(
116+
A, // Comment
117+
B,
118+
);
112119

113120
pub struct State<F: FnMut() -> time::Timespec> {
114121
now: F,
@@ -157,10 +164,18 @@ struct Foo<T>(
157164
TTTTTTTTTTTTTTTTTTT,
158165
UUUUUUUUUUUUUUUUUUU,
159166
);
160-
struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT)
167+
struct Foo<T>(
168+
TTTTTTTTTTTTTTTTTT,
169+
UUUUUUUUUUUUUUUUUUUUUUUU,
170+
TTTTTTTTTTTTTTTTTTT,
171+
)
161172
where
162173
T: PartialEq;
163-
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT)
174+
struct Foo<T>(
175+
TTTTTTTTTTTTTTTTT,
176+
UUUUUUUUUUUUUUUUUUUUUUUU,
177+
TTTTTTTTTTTTTTTTTTTTT,
178+
)
164179
where
165180
T: PartialEq;
166181
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)