22
33#![ allow( missing_docs, non_upper_case_globals, non_snake_case, clippy:: unreadable_literal) ]
44
5- use crate :: unicode:: version:: UnicodeVersion ;
65use crate :: unicode:: bool_trie:: { BoolTrie , SmallBoolTrie } ;
6+ use crate :: unicode:: version:: UnicodeVersion ;
77
88/// The version of [Unicode](http://www.unicode.org/) that the Unicode parts of
99/// `char` and `str` methods are based on.
1010#[ unstable( feature = "unicode_version" , issue = "49726" ) ]
11- pub const UNICODE_VERSION : UnicodeVersion = UnicodeVersion {
12- major : 12 ,
13- minor : 1 ,
14- micro : 0 ,
15- _priv : ( ) ,
16- } ;
11+ pub const UNICODE_VERSION : UnicodeVersion =
12+ UnicodeVersion { major : 12 , minor : 1 , micro : 0 , _priv : ( ) } ;
1713pub ( crate ) mod general_category {
14+ #[ rustfmt:: skip]
1815 const Cc_table : & super :: SmallBoolTrie = & super :: SmallBoolTrie {
1916 r1 : & [
2017 0 , 1 , 0
@@ -28,6 +25,7 @@ pub(crate) mod general_category {
2825 Cc_table . lookup ( c)
2926 }
3027
28+ #[ rustfmt:: skip]
3129 const N_table : & super :: BoolTrie = & super :: BoolTrie {
3230 r1 : [
3331 0x03ff000000000000 , 0x0000000000000000 , 0x720c000000000000 , 0x0000000000000000 ,
@@ -138,10 +136,10 @@ pub(crate) mod general_category {
138136 pub fn N ( c : char ) -> bool {
139137 N_table . lookup ( c)
140138 }
141-
142139}
143140
144141pub ( crate ) mod derived_property {
142+ #[ rustfmt:: skip]
145143 const Alphabetic_table : & super :: BoolTrie = & super :: BoolTrie {
146144 r1 : [
147145 0x0000000000000000 , 0x07fffffe07fffffe , 0x0420040000000000 , 0xff7fffffff7fffff ,
@@ -327,6 +325,7 @@ pub(crate) mod derived_property {
327325 Alphabetic_table . lookup ( c)
328326 }
329327
328+ #[ rustfmt:: skip]
330329 const Case_Ignorable_table : & super :: BoolTrie = & super :: BoolTrie {
331330 r1 : [
332331 0x0400408000000000 , 0x0000000140000000 , 0x0190a10000000000 , 0x0000000000000000 ,
@@ -464,6 +463,7 @@ pub(crate) mod derived_property {
464463 Case_Ignorable_table . lookup ( c)
465464 }
466465
466+ #[ rustfmt:: skip]
467467 const Cased_table : & super :: BoolTrie = & super :: BoolTrie {
468468 r1 : [
469469 0x0000000000000000 , 0x07fffffe07fffffe , 0x0420040000000000 , 0xff7fffffff7fffff ,
@@ -565,6 +565,7 @@ pub(crate) mod derived_property {
565565 Cased_table . lookup ( c)
566566 }
567567
568+ #[ rustfmt:: skip]
568569 const Grapheme_Extend_table : & super :: BoolTrie = & super :: BoolTrie {
569570 r1 : [
570571 0x0000000000000000 , 0x0000000000000000 , 0x0000000000000000 , 0x0000000000000000 ,
@@ -689,6 +690,7 @@ pub(crate) mod derived_property {
689690 Grapheme_Extend_table . lookup ( c)
690691 }
691692
693+ #[ rustfmt:: skip]
692694 const Lowercase_table : & super :: BoolTrie = & super :: BoolTrie {
693695 r1 : [
694696 0x0000000000000000 , 0x07fffffe00000000 , 0x0420040000000000 , 0xff7fffff80000000 ,
@@ -789,6 +791,7 @@ pub(crate) mod derived_property {
789791 Lowercase_table . lookup ( c)
790792 }
791793
794+ #[ rustfmt:: skip]
792795 const Uppercase_table : & super :: BoolTrie = & super :: BoolTrie {
793796 r1 : [
794797 0x0000000000000000 , 0x0000000007fffffe , 0x0000000000000000 , 0x000000007f7fffff ,
@@ -889,10 +892,10 @@ pub(crate) mod derived_property {
889892 pub fn Uppercase ( c : char ) -> bool {
890893 Uppercase_table . lookup ( c)
891894 }
892-
893895}
894896
895897pub ( crate ) mod property {
898+ #[ rustfmt:: skip]
896899 const White_Space_table : & super :: SmallBoolTrie = & super :: SmallBoolTrie {
897900 r1 : & [
898901 0 , 1 , 2 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ,
@@ -912,20 +915,19 @@ pub(crate) mod property {
912915 pub fn White_Space ( c : char ) -> bool {
913916 White_Space_table . lookup ( c)
914917 }
915-
916918}
917919
918920pub ( crate ) mod conversions {
919921 pub fn to_lower ( c : char ) -> [ char ; 3 ] {
920922 match bsearch_case_table ( c, to_lowercase_table) {
921- None => [ c, '\0' , '\0' ] ,
923+ None => [ c, '\0' , '\0' ] ,
922924 Some ( index) => to_lowercase_table[ index] . 1 ,
923925 }
924926 }
925927
926928 pub fn to_upper ( c : char ) -> [ char ; 3 ] {
927929 match bsearch_case_table ( c, to_uppercase_table) {
928- None => [ c, '\0' , '\0' ] ,
930+ None => [ c, '\0' , '\0' ] ,
929931 Some ( index) => to_uppercase_table[ index] . 1 ,
930932 }
931933 }
@@ -934,6 +936,7 @@ pub(crate) mod conversions {
934936 table. binary_search_by ( |& ( key, _) | key. cmp ( & c) ) . ok ( )
935937 }
936938
939+ #[ rustfmt:: skip]
937940 const to_lowercase_table: & [ ( char , [ char ; 3 ] ) ] = & [
938941 ( '\u{41}' , [ '\u{61}' , '\0' , '\0' ] ) , ( '\u{42}' , [ '\u{62}' , '\0' , '\0' ] ) , ( '\u{43}' ,
939942 [ '\u{63}' , '\0' , '\0' ] ) , ( '\u{44}' , [ '\u{64}' , '\0' , '\0' ] ) , ( '\u{45}' , [ '\u{65}' , '\0' ,
@@ -1558,6 +1561,7 @@ pub(crate) mod conversions {
15581561 ( '\u{1e920}' , [ '\u{1e942}' , '\0' , '\0' ] ) , ( '\u{1e921}' , [ '\u{1e943}' , '\0' , '\0' ] )
15591562 ] ;
15601563
1564+ #[ rustfmt:: skip]
15611565 const to_uppercase_table: & [ ( char , [ char ; 3 ] ) ] = & [
15621566 ( '\u{61}' , [ '\u{41}' , '\0' , '\0' ] ) , ( '\u{62}' , [ '\u{42}' , '\0' , '\0' ] ) , ( '\u{63}' ,
15631567 [ '\u{43}' , '\0' , '\0' ] ) , ( '\u{64}' , [ '\u{44}' , '\0' , '\0' ] ) , ( '\u{65}' , [ '\u{45}' , '\0' ,
@@ -2228,5 +2232,4 @@ pub(crate) mod conversions {
22282232 ( '\u{1e940}' , [ '\u{1e91e}' , '\0' , '\0' ] ) , ( '\u{1e941}' , [ '\u{1e91f}' , '\0' , '\0' ] ) ,
22292233 ( '\u{1e942}' , [ '\u{1e920}' , '\0' , '\0' ] ) , ( '\u{1e943}' , [ '\u{1e921}' , '\0' , '\0' ] )
22302234 ] ;
2231-
22322235}
0 commit comments