@@ -16,7 +16,7 @@ use option::{None, Option, Some};
16
16
use str;
17
17
use u32;
18
18
use uint;
19
- use unicode;
19
+ use unicode:: { derived_property , general_category } ;
20
20
21
21
#[ cfg( notest) ] use cmp:: Eq ;
22
22
@@ -53,18 +53,17 @@ use unicode;
53
53
Cn Unassigned a reserved unassigned code point or a noncharacter
54
54
*/
55
55
56
- pub use is_alphabetic = unicode:: derived_property:: Alphabetic ;
57
- pub use is_XID_start = unicode:: derived_property:: XID_Start ;
58
- pub use is_XID_continue = unicode:: derived_property:: XID_Continue ;
59
-
56
+ pub fn is_alphabetic ( c : char ) -> bool { derived_property:: Alphabetic ( c) }
57
+ pub fn is_XID_start ( c : char ) -> bool { derived_property:: XID_Start ( c) }
58
+ pub fn is_XID_continue ( c : char ) -> bool { derived_property:: XID_Continue ( c) }
60
59
61
60
/**
62
61
* Indicates whether a character is in lower case, defined
63
62
* in terms of the Unicode General Category 'Ll'
64
63
*/
65
64
#[ inline( always) ]
66
65
pub fn is_lowercase ( c : char ) -> bool {
67
- return unicode :: general_category:: Ll ( c) ;
66
+ return general_category:: Ll ( c) ;
68
67
}
69
68
70
69
/**
@@ -73,7 +72,7 @@ pub fn is_lowercase(c: char) -> bool {
73
72
*/
74
73
#[ inline( always) ]
75
74
pub fn is_uppercase ( c : char ) -> bool {
76
- return unicode :: general_category:: Lu ( c) ;
75
+ return general_category:: Lu ( c) ;
77
76
}
78
77
79
78
/**
@@ -84,9 +83,9 @@ pub fn is_uppercase(c: char) -> bool {
84
83
#[ inline( always) ]
85
84
pub fn is_whitespace ( c : char ) -> bool {
86
85
return ( '\x09' <= c && c <= '\x0d' )
87
- || unicode :: general_category:: Zs ( c)
88
- || unicode :: general_category:: Zl ( c)
89
- || unicode :: general_category:: Zp ( c) ;
86
+ || general_category:: Zs ( c)
87
+ || general_category:: Zl ( c)
88
+ || general_category:: Zp ( c) ;
90
89
}
91
90
92
91
/**
@@ -96,18 +95,18 @@ pub fn is_whitespace(c: char) -> bool {
96
95
*/
97
96
#[ inline( always) ]
98
97
pub fn is_alphanumeric ( c : char ) -> bool {
99
- return unicode :: derived_property:: Alphabetic ( c) ||
100
- unicode :: general_category:: Nd ( c) ||
101
- unicode :: general_category:: Nl ( c) ||
102
- unicode :: general_category:: No ( c) ;
98
+ return derived_property:: Alphabetic ( c) ||
99
+ general_category:: Nd ( c) ||
100
+ general_category:: Nl ( c) ||
101
+ general_category:: No ( c) ;
103
102
}
104
103
105
104
/// Indicates whether the character is numeric (Nd, Nl, or No)
106
105
#[ inline( always) ]
107
106
pub fn is_digit ( c : char ) -> bool {
108
- return unicode :: general_category:: Nd ( c) ||
109
- unicode :: general_category:: Nl ( c) ||
110
- unicode :: general_category:: No ( c) ;
107
+ return general_category:: Nd ( c) ||
108
+ general_category:: Nl ( c) ||
109
+ general_category:: No ( c) ;
111
110
}
112
111
113
112
/**
0 commit comments