2
2
3
3
#![ allow( missing_docs, non_upper_case_globals, non_snake_case, clippy:: unreadable_literal) ]
4
4
5
- use crate :: unicode:: version:: UnicodeVersion ;
6
5
use crate :: unicode:: bool_trie:: { BoolTrie , SmallBoolTrie } ;
6
+ use crate :: unicode:: version:: UnicodeVersion ;
7
7
8
8
/// The version of [Unicode](http://www.unicode.org/) that the Unicode parts of
9
9
/// `char` and `str` methods are based on.
10
10
#[ 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 : ( ) } ;
17
13
pub ( crate ) mod general_category {
14
+ #[ rustfmt:: skip]
18
15
const Cc_table : & super :: SmallBoolTrie = & super :: SmallBoolTrie {
19
16
r1 : & [
20
17
0 , 1 , 0
@@ -28,6 +25,7 @@ pub(crate) mod general_category {
28
25
Cc_table . lookup ( c)
29
26
}
30
27
28
+ #[ rustfmt:: skip]
31
29
const N_table : & super :: BoolTrie = & super :: BoolTrie {
32
30
r1 : [
33
31
0x03ff000000000000 , 0x0000000000000000 , 0x720c000000000000 , 0x0000000000000000 ,
@@ -138,10 +136,10 @@ pub(crate) mod general_category {
138
136
pub fn N ( c : char ) -> bool {
139
137
N_table . lookup ( c)
140
138
}
141
-
142
139
}
143
140
144
141
pub ( crate ) mod derived_property {
142
+ #[ rustfmt:: skip]
145
143
const Alphabetic_table : & super :: BoolTrie = & super :: BoolTrie {
146
144
r1 : [
147
145
0x0000000000000000 , 0x07fffffe07fffffe , 0x0420040000000000 , 0xff7fffffff7fffff ,
@@ -327,6 +325,7 @@ pub(crate) mod derived_property {
327
325
Alphabetic_table . lookup ( c)
328
326
}
329
327
328
+ #[ rustfmt:: skip]
330
329
const Case_Ignorable_table : & super :: BoolTrie = & super :: BoolTrie {
331
330
r1 : [
332
331
0x0400408000000000 , 0x0000000140000000 , 0x0190a10000000000 , 0x0000000000000000 ,
@@ -464,6 +463,7 @@ pub(crate) mod derived_property {
464
463
Case_Ignorable_table . lookup ( c)
465
464
}
466
465
466
+ #[ rustfmt:: skip]
467
467
const Cased_table : & super :: BoolTrie = & super :: BoolTrie {
468
468
r1 : [
469
469
0x0000000000000000 , 0x07fffffe07fffffe , 0x0420040000000000 , 0xff7fffffff7fffff ,
@@ -565,6 +565,7 @@ pub(crate) mod derived_property {
565
565
Cased_table . lookup ( c)
566
566
}
567
567
568
+ #[ rustfmt:: skip]
568
569
const Grapheme_Extend_table : & super :: BoolTrie = & super :: BoolTrie {
569
570
r1 : [
570
571
0x0000000000000000 , 0x0000000000000000 , 0x0000000000000000 , 0x0000000000000000 ,
@@ -689,6 +690,7 @@ pub(crate) mod derived_property {
689
690
Grapheme_Extend_table . lookup ( c)
690
691
}
691
692
693
+ #[ rustfmt:: skip]
692
694
const Lowercase_table : & super :: BoolTrie = & super :: BoolTrie {
693
695
r1 : [
694
696
0x0000000000000000 , 0x07fffffe00000000 , 0x0420040000000000 , 0xff7fffff80000000 ,
@@ -789,6 +791,7 @@ pub(crate) mod derived_property {
789
791
Lowercase_table . lookup ( c)
790
792
}
791
793
794
+ #[ rustfmt:: skip]
792
795
const Uppercase_table : & super :: BoolTrie = & super :: BoolTrie {
793
796
r1 : [
794
797
0x0000000000000000 , 0x0000000007fffffe , 0x0000000000000000 , 0x000000007f7fffff ,
@@ -889,10 +892,10 @@ pub(crate) mod derived_property {
889
892
pub fn Uppercase ( c : char ) -> bool {
890
893
Uppercase_table . lookup ( c)
891
894
}
892
-
893
895
}
894
896
895
897
pub ( crate ) mod property {
898
+ #[ rustfmt:: skip]
896
899
const White_Space_table : & super :: SmallBoolTrie = & super :: SmallBoolTrie {
897
900
r1 : & [
898
901
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 {
912
915
pub fn White_Space ( c : char ) -> bool {
913
916
White_Space_table . lookup ( c)
914
917
}
915
-
916
918
}
917
919
918
920
pub ( crate ) mod conversions {
919
921
pub fn to_lower ( c : char ) -> [ char ; 3 ] {
920
922
match bsearch_case_table ( c, to_lowercase_table) {
921
- None => [ c, '\0' , '\0' ] ,
923
+ None => [ c, '\0' , '\0' ] ,
922
924
Some ( index) => to_lowercase_table[ index] . 1 ,
923
925
}
924
926
}
925
927
926
928
pub fn to_upper ( c : char ) -> [ char ; 3 ] {
927
929
match bsearch_case_table ( c, to_uppercase_table) {
928
- None => [ c, '\0' , '\0' ] ,
930
+ None => [ c, '\0' , '\0' ] ,
929
931
Some ( index) => to_uppercase_table[ index] . 1 ,
930
932
}
931
933
}
@@ -934,6 +936,7 @@ pub(crate) mod conversions {
934
936
table. binary_search_by ( |& ( key, _) | key. cmp ( & c) ) . ok ( )
935
937
}
936
938
939
+ #[ rustfmt:: skip]
937
940
const to_lowercase_table: & [ ( char , [ char ; 3 ] ) ] = & [
938
941
( '\u{41}' , [ '\u{61}' , '\0' , '\0' ] ) , ( '\u{42}' , [ '\u{62}' , '\0' , '\0' ] ) , ( '\u{43}' ,
939
942
[ '\u{63}' , '\0' , '\0' ] ) , ( '\u{44}' , [ '\u{64}' , '\0' , '\0' ] ) , ( '\u{45}' , [ '\u{65}' , '\0' ,
@@ -1558,6 +1561,7 @@ pub(crate) mod conversions {
1558
1561
( '\u{1e920}' , [ '\u{1e942}' , '\0' , '\0' ] ) , ( '\u{1e921}' , [ '\u{1e943}' , '\0' , '\0' ] )
1559
1562
] ;
1560
1563
1564
+ #[ rustfmt:: skip]
1561
1565
const to_uppercase_table: & [ ( char , [ char ; 3 ] ) ] = & [
1562
1566
( '\u{61}' , [ '\u{41}' , '\0' , '\0' ] ) , ( '\u{62}' , [ '\u{42}' , '\0' , '\0' ] ) , ( '\u{63}' ,
1563
1567
[ '\u{43}' , '\0' , '\0' ] ) , ( '\u{64}' , [ '\u{44}' , '\0' , '\0' ] ) , ( '\u{65}' , [ '\u{45}' , '\0' ,
@@ -2228,5 +2232,4 @@ pub(crate) mod conversions {
2228
2232
( '\u{1e940}' , [ '\u{1e91e}' , '\0' , '\0' ] ) , ( '\u{1e941}' , [ '\u{1e91f}' , '\0' , '\0' ] ) ,
2229
2233
( '\u{1e942}' , [ '\u{1e920}' , '\0' , '\0' ] ) , ( '\u{1e943}' , [ '\u{1e921}' , '\0' , '\0' ] )
2230
2234
] ;
2231
-
2232
2235
}
0 commit comments