@@ -80,7 +80,7 @@ static TAG_FOUR_B: uint = 240u;
80
80
/// The highest valid code point
81
81
pub static MAX : char = ' \U 0010 ffff' ;
82
82
83
- /// Convert from `u32` to a `char`.
83
+ /// Converts from `u32` to a `char`
84
84
#[ inline]
85
85
pub fn from_u32 ( i : u32 ) -> Option < char > {
86
86
// catch out-of-bounds and surrogates
@@ -91,31 +91,34 @@ pub fn from_u32(i: u32) -> Option<char> {
91
91
}
92
92
}
93
93
94
- /// Returns whether the specified `char` is considered a unicode alphabetic
95
- /// scalar value
94
+ /// Returns whether the specified `char` is considered a Unicode alphabetic
95
+ /// code point
96
96
pub fn is_alphabetic ( c : char ) -> bool { derived_property:: Alphabetic ( c) }
97
97
#[ allow( missing_doc) ]
98
98
pub fn is_XID_start ( c : char ) -> bool { derived_property:: XID_Start ( c) }
99
99
#[ allow( missing_doc) ]
100
100
pub fn is_XID_continue ( c : char ) -> bool { derived_property:: XID_Continue ( c) }
101
101
102
102
///
103
- /// Indicates whether a `char` is in lower case, defined
104
- /// in terms of the Unicode Derived Core Property 'Lowercase'.
103
+ /// Indicates whether a `char` is in lower case
104
+ ///
105
+ /// This is defined according to the terms of the Unicode Derived Core Property 'Lowercase'.
105
106
///
106
107
#[ inline]
107
108
pub fn is_lowercase ( c : char ) -> bool { derived_property:: Lowercase ( c) }
108
109
109
110
///
110
- /// Indicates whether a `char` is in upper case, defined
111
- /// in terms of the Unicode Derived Core Property 'Uppercase'.
111
+ /// Indicates whether a `char` is in upper case
112
+ ///
113
+ /// This is defined according to the terms of the Unicode Derived Core Property 'Uppercase'.
112
114
///
113
115
#[ inline]
114
116
pub fn is_uppercase ( c : char ) -> bool { derived_property:: Uppercase ( c) }
115
117
116
118
///
117
- /// Indicates whether a `char` is whitespace. Whitespace is defined in
118
- /// terms of the Unicode Property 'White_Space'.
119
+ /// Indicates whether a `char` is whitespace
120
+ ///
121
+ /// Whitespace is defined in terms of the Unicode Property 'White_Space'.
119
122
///
120
123
#[ inline]
121
124
pub fn is_whitespace ( c : char ) -> bool {
@@ -126,9 +129,10 @@ pub fn is_whitespace(c: char) -> bool {
126
129
}
127
130
128
131
///
129
- /// Indicates whether a `char` is alphanumeric. Alphanumericness is
130
- /// defined in terms of the Unicode General Categories 'Nd', 'Nl', 'No'
131
- /// and the Derived Core Property 'Alphabetic'.
132
+ /// Indicates whether a `char` is alphanumeric
133
+ ///
134
+ /// Alphanumericness is defined in terms of the Unicode General Categories
135
+ /// 'Nd', 'Nl', 'No' and the Derived Core Property 'Alphabetic'.
132
136
///
133
137
#[ inline]
134
138
pub fn is_alphanumeric ( c : char ) -> bool {
@@ -139,8 +143,9 @@ pub fn is_alphanumeric(c: char) -> bool {
139
143
}
140
144
141
145
///
142
- /// Indicates whether a `char` is a control code point. Control
143
- /// code points are defined in terms of the Unicode General Category
146
+ /// Indicates whether a `char` is a control code point
147
+ ///
148
+ /// Control code points are defined in terms of the Unicode General Category
144
149
/// 'Cc'.
145
150
///
146
151
#[ inline]
@@ -155,7 +160,8 @@ pub fn is_digit(c: char) -> bool {
155
160
}
156
161
157
162
///
158
- /// Checks if a `char` parses as a numeric digit in the given radix.
163
+ /// Checks if a `char` parses as a numeric digit in the given radix
164
+ ///
159
165
/// Compared to `is_digit()`, this function only recognizes the
160
166
/// characters `0-9`, `a-z` and `A-Z`.
161
167
///
@@ -181,7 +187,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool {
181
187
}
182
188
183
189
///
184
- /// Convert a `char` to the corresponding digit.
190
+ /// Converts a `char` to the corresponding digit
185
191
///
186
192
/// # Return value
187
193
///
@@ -210,7 +216,7 @@ pub fn to_digit(c: char, radix: uint) -> Option<uint> {
210
216
}
211
217
212
218
///
213
- /// Converts a number to the character representing it.
219
+ /// Converts a number to the character representing it
214
220
///
215
221
/// # Return value
216
222
///
@@ -268,7 +274,7 @@ fn decompose_hangul(s: char, f: |char|) {
268
274
}
269
275
}
270
276
271
- /// Returns the canonical decomposition of a character.
277
+ /// Returns the canonical decomposition of a character
272
278
pub fn decompose_canonical ( c : char , f: |char|) {
273
279
if ( c as uint ) < S_BASE || ( c as uint ) >= ( S_BASE + S_COUNT ) {
274
280
decompose:: canonical ( c, f) ;
@@ -277,7 +283,7 @@ pub fn decompose_canonical(c: char, f: |char|) {
277
283
}
278
284
}
279
285
280
- /// Returns the compatibility decomposition of a character.
286
+ /// Returns the compatibility decomposition of a character
281
287
pub fn decompose_compatible ( c : char , f: |char|) {
282
288
if ( c as uint ) < S_BASE || ( c as uint ) >= ( S_BASE + S_COUNT ) {
283
289
decompose:: compatibility ( c, f) ;
@@ -287,7 +293,7 @@ pub fn decompose_compatible(c: char, f: |char|) {
287
293
}
288
294
289
295
///
290
- /// Return the hexadecimal unicode escape of a `char`.
296
+ /// Returns the hexadecimal Unicode escape of a `char`
291
297
///
292
298
/// The rules are as follows:
293
299
///
@@ -315,7 +321,7 @@ pub fn escape_unicode(c: char, f: |char|) {
315
321
}
316
322
317
323
///
318
- /// Return a 'default' ASCII and C++11-like literal escape of a `char`.
324
+ /// Returns a 'default' ASCII and C++11-like literal escape of a `char`
319
325
///
320
326
/// The default is chosen with a bias toward producing literals that are
321
327
/// legal in a variety of languages, including C++11 and similar C-family
@@ -374,8 +380,9 @@ pub trait Char {
374
380
fn escape_default ( & self , f: |char|) ;
375
381
fn len_utf8_bytes ( & self ) -> uint ;
376
382
377
- /// Encodes this `char` as utf-8 into the provided byte-buffer. The
378
- /// buffer must be at least 4 bytes long or a runtime failure will occur.
383
+ /// Encodes this `char` as utf-8 into the provided byte-buffer
384
+ ///
385
+ /// The buffer must be at least 4 bytes long or a runtime failure will occur.
379
386
///
380
387
/// This will then return the number of characters written to the slice.
381
388
fn encode_utf8 ( & self , dst : & mut [ u8 ] ) -> uint ;
0 commit comments