Skip to content

Commit f4cff27

Browse files
committed
Make libcore/unicode/printable.rs compatible with rustfmt
1 parent d353a4c commit f4cff27

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/libcore/unicode/printable.py

100644100755
+4-2
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,19 @@ def compress_normal(normal):
111111
return compressed
112112

113113
def print_singletons(uppers, lowers, uppersname, lowersname):
114+
print("#[rustfmt::skip]")
114115
print("const {}: &[(u8, u8)] = &[".format(uppersname))
115116
for u, c in uppers:
116117
print(" ({:#04x}, {}),".format(u, c))
117118
print("];")
119+
print("#[rustfmt::skip]")
118120
print("const {}: &[u8] = &[".format(lowersname))
119121
for i in range(0, len(lowers), 8):
120122
print(" {}".format(" ".join("{:#04x},".format(l) for l in lowers[i:i+8])))
121123
print("];")
122124

123125
def print_normal(normal, normalname):
126+
print("#[rustfmt::skip]")
124127
print("const {}: &[u8] = &[".format(normalname))
125128
for v in normal:
126129
print(" {}".format(" ".join("{:#04x},".format(i) for i in v)))
@@ -170,8 +173,7 @@ def main():
170173
// NOTE: The following code was generated by "src/libcore/unicode/printable.py",
171174
// do not edit directly!
172175
173-
fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8],
174-
normal: &[u8]) -> bool {
176+
fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8], normal: &[u8]) -> bool {
175177
let xupper = (x >> 8) as u8;
176178
let mut lowerstart = 0;
177179
for &(upper, lowercount) in singletonuppers {

src/libcore/unicode/printable.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// NOTE: The following code was generated by "src/libcore/unicode/printable.py",
22
// do not edit directly!
33

4-
fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8],
5-
normal: &[u8]) -> bool {
4+
fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8], normal: &[u8]) -> bool {
65
let xupper = (x >> 8) as u8;
76
let mut lowerstart = 0;
87
for &(upper, lowercount) in singletonuppers {
@@ -70,6 +69,7 @@ pub(crate) fn is_printable(x: char) -> bool {
7069
}
7170
}
7271

72+
#[rustfmt::skip]
7373
const SINGLETONS0U: &[(u8, u8)] = &[
7474
(0x00, 1),
7575
(0x03, 5),
@@ -113,6 +113,7 @@ const SINGLETONS0U: &[(u8, u8)] = &[
113113
(0xfe, 3),
114114
(0xff, 9),
115115
];
116+
#[rustfmt::skip]
116117
const SINGLETONS0L: &[u8] = &[
117118
0xad, 0x78, 0x79, 0x8b, 0x8d, 0xa2, 0x30, 0x57,
118119
0x58, 0x8b, 0x8c, 0x90, 0x1c, 0x1d, 0xdd, 0x0e,
@@ -152,6 +153,7 @@ const SINGLETONS0L: &[u8] = &[
152153
0xff, 0x53, 0x67, 0x75, 0xc8, 0xc9, 0xd0, 0xd1,
153154
0xd8, 0xd9, 0xe7, 0xfe, 0xff,
154155
];
156+
#[rustfmt::skip]
155157
const SINGLETONS1U: &[(u8, u8)] = &[
156158
(0x00, 6),
157159
(0x01, 1),
@@ -189,6 +191,7 @@ const SINGLETONS1U: &[(u8, u8)] = &[
189191
(0xf9, 6),
190192
(0xfa, 2),
191193
];
194+
#[rustfmt::skip]
192195
const SINGLETONS1L: &[u8] = &[
193196
0x0c, 0x27, 0x3b, 0x3e, 0x4e, 0x4f, 0x8f, 0x9e,
194197
0x9e, 0x9f, 0x06, 0x07, 0x09, 0x36, 0x3d, 0x3e,
@@ -212,6 +215,7 @@ const SINGLETONS1L: &[u8] = &[
212215
0xa4, 0xaa, 0xaf, 0xb0, 0xc0, 0xd0, 0x0c, 0x72,
213216
0xa3, 0xa4, 0xcb, 0xcc, 0x6e, 0x6f,
214217
];
218+
#[rustfmt::skip]
215219
const NORMAL0: &[u8] = &[
216220
0x00, 0x20,
217221
0x5f, 0x22,
@@ -355,6 +359,7 @@ const NORMAL0: &[u8] = &[
355359
0x1b, 0x03,
356360
0x0f, 0x0d,
357361
];
362+
#[rustfmt::skip]
358363
const NORMAL1: &[u8] = &[
359364
0x5e, 0x22,
360365
0x7b, 0x05,

0 commit comments

Comments
 (0)