@@ -121,17 +121,17 @@ def compress_normal(normal):
121
121
return compressed
122
122
123
123
def print_singletons (uppers , lowers , uppersname , lowersname ):
124
- print ("const {}: &'static [(u8, u8)] = &[" .format (uppersname ))
124
+ print ("const {}: &[(u8, u8)] = &[" .format (uppersname ))
125
125
for u , c in uppers :
126
126
print (" ({:#04x}, {})," .format (u , c ))
127
127
print ("];" )
128
- print ("const {}: &'static [u8] = &[" .format (lowersname ))
128
+ print ("const {}: &[u8] = &[" .format (lowersname ))
129
129
for i in range (0 , len (lowers ), 8 ):
130
130
print (" {}" .format (" " .join ("{:#04x}," .format (l ) for l in lowers [i :i + 8 ])))
131
131
print ("];" )
132
132
133
133
def print_normal (normal , normalname ):
134
- print ("const {}: &'static [u8] = &[" .format (normalname ))
134
+ print ("const {}: &[u8] = &[" .format (normalname ))
135
135
for v in normal :
136
136
print (" {}" .format (" " .join ("{:#04x}," .format (i ) for i in v )))
137
137
print ("];" )
@@ -187,8 +187,8 @@ def main():
187
187
// option. This file may not be copied, modified, or distributed
188
188
// except according to those terms.
189
189
190
- // NOTE: The following code was generated by " src/etc/char_private.py",
191
- // do not edit directly!
190
+ //! NOTE: The following code was generated by ` src/etc/char_private.py`;
191
+ //! do not edit directly!
192
192
193
193
fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8],
194
194
normal: &[u8]) -> bool {
@@ -226,12 +226,13 @@ def main():
226
226
current
227
227
}
228
228
229
+ #[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
229
230
pub(crate) fn is_printable(x: char) -> bool {
230
231
let x = x as u32;
231
232
let lower = x as u16;
232
- if x < 0x10000 {
233
+ if x < (1 << 16) {
233
234
check(lower, SINGLETONS0U, SINGLETONS0L, NORMAL0)
234
- } else if x < 0x20000 {
235
+ } else if x < (2 << 16) {
235
236
check(lower, SINGLETONS1U, SINGLETONS1L, NORMAL1)
236
237
} else {\
237
238
""" )
0 commit comments