Skip to content

Commit d1871ba

Browse files
committed
Fix trailing whitespace
1 parent 40d07eb commit d1871ba

12 files changed

+288
-287
lines changed

src/cli.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ fn side_by_side(left: &str, right: &str) -> String {
424424
.checked_sub(len_ignoring_markup(l))
425425
.unwrap_or_default();
426426
let pad = " ".repeat(pad);
427-
let _ = writeln!(&mut out, " {l}{pad} | {r}");
427+
let gap = if r.is_empty() { "" } else { " " }; // avoid trailing whitespace
428+
let _ = writeln!(&mut out, " {l}{pad} |{gap}{r}");
428429
}
429430
out
430431
}

tests/snapshots/[email protected]

+115-115
Large diffs are not rendered by default.

tests/snapshots/[email protected]

+8-8
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ The old ruleset is on the left, and the new one on the right.
121121
---------------------- "BindingBorrow" | ---------------------- "BindingBorrow"
122122
real, mref mut x: T | real, mref mut x: T
123123

124-
|
124+
|
125125
----------- "Binding" | ----------- "Binding"
126126
r, mx: T | r, mx: T
127127

128-
|
128+
|
129129
------------------ "Binding" | ------------------ "Binding"
130130
real, mmut x: T | real, mmut x: T
131131

132-
|
133-
------------------ "Binding" |
134-
inh, mmut x: &T |
132+
|
133+
------------------ "Binding" |
134+
inh, mmut x: &T |
135135

136-
|
137-
---------------------- "Binding" |
138-
inh, mmut x: &mut T |
136+
|
137+
---------------------- "Binding" |
138+
inh, mmut x: &mut T |
139139

140140

141141
allow_ref_pat_on_ref_mut: true

tests/snapshots/[email protected]

+8-8
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ The old ruleset is on the left, and the new one on the right.
121121
---------------------- "BindingBorrow" | ---------------------- "BindingBorrow"
122122
real, mref mut x: T | real, mref mut x: T
123123

124-
|
124+
|
125125
----------- "Binding" | ----------- "Binding"
126126
r, mx: T | r, mx: T
127127

128-
|
128+
|
129129
------------------ "Binding" | ------------------ "Binding"
130130
real, mmut x: T | real, mmut x: T
131131

132-
|
133-
------------------ "Binding" |
134-
inh, mmut x: &T |
132+
|
133+
------------------ "Binding" |
134+
inh, mmut x: &T |
135135

136-
|
137-
---------------------- "Binding" |
138-
inh, mmut x: &mut T |
136+
|
137+
---------------------- "Binding" |
138+
inh, mmut x: &mut T |
139139

140140

141141
allow_ref_pat_on_ref_mut: true

tests/snapshots/[email protected]

+56-56
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,77 @@ The old ruleset is on the left, and the new one on the right.
99
----------------------------------- "Constructor" | ----------------------------------- "Constructor"
1010
_, m ⊢ [p0, p1]: [T0, T1] | _, m ⊢ [p0, p1]: [T0, T1]
1111

12-
inh, rop0: &T0, inh, rop1: &T1 |
13-
------------------------------------- "ConstructorRef" |
14-
r, m ⊢ [p0, p1]: &[T0, T1] |
12+
inh, rop0: &T0, inh, rop1: &T1 |
13+
------------------------------------- "ConstructorRef" |
14+
r, m ⊢ [p0, p1]: &[T0, T1] |
1515

16-
inh, mp0: &mut T0, inh, mp1: &mut T1 |
17-
------------------------------------------- "ConstructorRef" |
18-
r, m ⊢ [p0, p1]: &mut [T0, T1] |
16+
inh, mp0: &mut T0, inh, mp1: &mut T1 |
17+
------------------------------------------- "ConstructorRef" |
18+
r, m ⊢ [p0, p1]: &mut [T0, T1] |
1919

20-
inh, ro ⊢ [p0, p1]: &T |
21-
---------------------- "ConstructorMultiRef" |
22-
r, m ⊢ [p0, p1]: &&T |
20+
inh, ro ⊢ [p0, p1]: &T |
21+
---------------------- "ConstructorMultiRef" |
22+
r, m ⊢ [p0, p1]: &&T |
2323

24-
inh, ro ⊢ [p0, p1]: &T |
25-
------------------------ "ConstructorMultiRef" |
26-
r, m ⊢ [p0, p1]: &&mut T |
24+
inh, ro ⊢ [p0, p1]: &T |
25+
------------------------ "ConstructorMultiRef" |
26+
r, m ⊢ [p0, p1]: &&mut T |
2727

28-
inh, ro ⊢ [p0, p1]: &T |
29-
------------------------ "ConstructorMultiRef" |
30-
r, m ⊢ [p0, p1]: &mut &T |
28+
inh, ro ⊢ [p0, p1]: &T |
29+
------------------------ "ConstructorMultiRef" |
30+
r, m ⊢ [p0, p1]: &mut &T |
3131

32-
inh, m ⊢ [p0, p1]: &mut T |
33-
---------------------------- "ConstructorMultiRef" |
34-
r, m ⊢ [p0, p1]: &mut &mut T |
32+
inh, m ⊢ [p0, p1]: &mut T |
33+
---------------------------- "ConstructorMultiRef" |
34+
r, m ⊢ [p0, p1]: &mut &mut T |
3535

3636
real, rop: T | real, rop: T
3737
---------------- "Deref" | ---------------- "Deref"
3838
real, m&p: &T | real, m&p: &T
3939

40-
_, rop: T |
41-
------------------------------------- "Deref" |
42-
inh, m&p: &T, T is not a reference |
40+
_, rop: T |
41+
------------------------------------- "Deref" |
42+
inh, m&p: &T, T is not a reference |
4343

44-
real, rop: &T |
45-
---------------- "Deref" |
46-
inh, m&p: &&T |
44+
real, rop: &T |
45+
---------------- "Deref" |
46+
inh, m&p: &&T |
4747

48-
real, rop: &mut T |
49-
-------------------- "Deref" |
50-
inh, m&p: &&mut T |
48+
real, rop: &mut T |
49+
-------------------- "Deref" |
50+
inh, m&p: &&mut T |
5151

5252
real, mp: T | real, mp: T
5353
------------------------ "Deref" | ------------------------ "Deref"
5454
real, m&mut p: &mut T | real, m&mut p: &mut T
5555

56-
_, mp: T |
57-
--------------------------------------------- "Deref" |
58-
inh, m&mut p: &mut T, T is not a reference |
56+
_, mp: T |
57+
--------------------------------------------- "Deref" |
58+
inh, m&mut p: &mut T, T is not a reference |
5959

60-
real, mp: &T |
61-
------------------------ "Deref" |
62-
inh, m&mut p: &mut &T |
60+
real, mp: &T |
61+
------------------------ "Deref" |
62+
inh, m&mut p: &mut &T |
6363

64-
real, mp: &mut T |
65-
---------------------------- "Deref" |
66-
inh, m&mut p: &mut &mut T |
64+
real, mp: &mut T |
65+
---------------------------- "Deref" |
66+
inh, m&mut p: &mut &mut T |
6767

68-
real, rop: T |
69-
-------------------- "DerefMutWithShared" |
70-
real, m&p: &mut T |
68+
real, rop: T |
69+
-------------------- "DerefMutWithShared" |
70+
real, m&p: &mut T |
7171

72-
_, rop: T |
73-
----------------------------------------- "DerefMutWithShared" |
74-
inh, m&p: &mut T, T is not a reference |
72+
_, rop: T |
73+
----------------------------------------- "DerefMutWithShared" |
74+
inh, m&p: &mut T, T is not a reference |
7575

76-
real, rop: &T |
77-
-------------------- "DerefMutWithShared" |
78-
inh, m&p: &mut &T |
76+
real, rop: &T |
77+
-------------------- "DerefMutWithShared" |
78+
inh, m&p: &mut &T |
7979

80-
real, rop: &mut T |
81-
------------------------ "DerefMutWithShared" |
82-
inh, m&p: &mut &mut T |
80+
real, rop: &mut T |
81+
------------------------ "DerefMutWithShared" |
82+
inh, m&p: &mut &mut T |
8383

8484
inh, mx: &T | inh, mx: &T
8585
------------------ "BindingBorrow" | ------------------ "BindingBorrow"
@@ -89,21 +89,21 @@ The old ruleset is on the left, and the new one on the right.
8989
---------------------- "BindingBorrow" | ---------------------- "BindingBorrow"
9090
real, mref mut x: T | real, mref mut x: T
9191

92-
|
92+
|
9393
----------- "Binding" | ----------- "Binding"
9494
r, mx: T | r, mx: T
9595

96-
|
96+
|
9797
------------------ "Binding" | ------------------ "Binding"
9898
real, mmut x: T | real, mmut x: T
9999

100-
|
101-
------------------ "Binding" |
102-
inh, mmut x: &T |
100+
|
101+
------------------ "Binding" |
102+
inh, mmut x: &T |
103103

104-
|
105-
---------------------- "Binding" |
106-
inh, mmut x: &mut T |
104+
|
105+
---------------------- "Binding" |
106+
inh, mmut x: &mut T |
107107

108108

109109
allow_ref_pat_on_ref_mut: true -> false

tests/snapshots/[email protected]

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ The old ruleset is on the left, and the new one on the right.
5757
--------------------------------------------- "Deref" | --------------------------------------------- "Deref(EatOuter)"
5858
inh, m&mut p: &mut T, T is not a reference | inh, m&mut p: &mut T, T is not a reference
5959

60-
real, mp: &T |
61-
------------------------ "Deref" |
62-
inh, m&mut p: &mut &T |
60+
real, mp: &T |
61+
------------------------ "Deref" |
62+
inh, m&mut p: &mut &T |
6363

6464
real, mp: &mut T | inh, mp: &mut T
6565
---------------------------- "Deref" | ---------------------------- "Deref(EatInner)"
@@ -93,11 +93,11 @@ The old ruleset is on the left, and the new one on the right.
9393
---------------------- "BindingBorrow" | ---------------------- "BindingBorrow"
9494
real, mref mut x: T | real, mref mut x: T
9595

96-
|
96+
|
9797
----------- "Binding" | ----------- "Binding"
9898
r, mx: T | r, mx: T
9999

100-
|
100+
|
101101
--------------- "Binding" | --------------- "Binding"
102102
r, mmut x: T | r, mmut x: T
103103

0 commit comments

Comments
 (0)