@@ -121,17 +121,17 @@ def compress_normal(normal):
121121 return compressed
122122
123123def print_singletons (uppers , lowers , uppersname , lowersname ):
124- print ("const {}: &'static [(u8, u8)] = &[" .format (uppersname ))
124+ print ("const {}: &[(u8, u8)] = &[" .format (uppersname ))
125125 for u , c in uppers :
126126 print (" ({:#04x}, {})," .format (u , c ))
127127 print ("];" )
128- print ("const {}: &'static [u8] = &[" .format (lowersname ))
128+ print ("const {}: &[u8] = &[" .format (lowersname ))
129129 for i in range (0 , len (lowers ), 8 ):
130130 print (" {}" .format (" " .join ("{:#04x}," .format (l ) for l in lowers [i :i + 8 ])))
131131 print ("];" )
132132
133133def print_normal (normal , normalname ):
134- print ("const {}: &'static [u8] = &[" .format (normalname ))
134+ print ("const {}: &[u8] = &[" .format (normalname ))
135135 for v in normal :
136136 print (" {}" .format (" " .join ("{:#04x}," .format (i ) for i in v )))
137137 print ("];" )
@@ -187,8 +187,8 @@ def main():
187187// option. This file may not be copied, modified, or distributed
188188// except according to those terms.
189189
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!
192192
193193fn check(x: u16, singletonuppers: &[(u8, u8)], singletonlowers: &[u8],
194194 normal: &[u8]) -> bool {
@@ -226,12 +226,13 @@ def main():
226226 current
227227}
228228
229+ #[cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
229230pub(crate) fn is_printable(x: char) -> bool {
230231 let x = x as u32;
231232 let lower = x as u16;
232- if x < 0x10000 {
233+ if x < (1 << 16) {
233234 check(lower, SINGLETONS0U, SINGLETONS0L, NORMAL0)
234- } else if x < 0x20000 {
235+ } else if x < (2 << 16) {
235236 check(lower, SINGLETONS1U, SINGLETONS1L, NORMAL1)
236237 } else {\
237238 """ )
0 commit comments